企业版 Qt Debian 软件包
要在 Qt 中使用企业级 Debian 软件包,请将企业级软件源添加到高级打包工具 (APT)。有关详情,请参阅Debian 资源库配置格式。
要使用企业软件源,你需要
- 为企业版本库安装公共 GPG 密钥
- 为企业版本库访问配置基于 Qt 账户的身份验证
- 配置软件源
Debian 资源库配置格式
要为 APT 添加额外的软件源,请将软件源插入/etc/apt/sources.list.d目录下扩展名为.list的文件。为每个软件源在文件中添加一个新条目。通用格式如下:
deb [arch=<arch> signed-by=<path>] <REPO_URL> <DIST> <COMPONENT(s)>
企业版本库条目示例:
$ sudo nano /etc/apt/sources.list.d/tqtc.list deb [arch=arm64 signed-by=/etc/apt/keyrings/tqtc/qt-company-debian-repo.gpg] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64 tqtc-jammy main
有关如何按Qt 版本和架构配置软件源的详细信息,请参阅 Qt 版本的软件源信息。
Debian 源代码包
要为 APT 添加 Debian 源代码包,需要为相应的deb条目添加deb-src条目:
$ sudo nano /etc/apt/sources.list.d/tqtc.list deb [arch=arm64 signed-by=/etc/apt/keyrings/tqtc/qt-company-debian-repo.gpg] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64 tqtc-jammy main deb-src [signed-by=/etc/apt/keyrings/tqtc/qt-company-debian-repo.gpg] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64 tqtc-jammy main
要将源码包(例如wayland)下载到当前目录,请使用apt source
命令:
$ sudo apt source qt-6.9.1-wayland-src
安装公共 GPG 密钥
为 Enterprise Qt Debian 软件源安装公共 GPG(GNU 隐私保护)密钥,方法如下:
$ sudo mkdir -p /etc/apt/keyrings/tqtc # Create the directory with appropriate permissions $ cd /etc/apt/keyrings/tqtc $ sudo wget https://cdn.qt.io/debian/keys/qt-company-debian-repo.gpg
配置身份验证
要访问列出的软件源,您需要一个企业 Qt 账户或评估 Qt 账户。
注意: 如果密码包含特殊字符,可能需要使用"\"或"%40 "来转义。
为你的 APT 软件包管理器配置 Qt 账户凭据如下:
$ sudo nano /etc/apt/auth.conf machine https://debian-packages.qt.io login <Qt Account login name (email)> password <Qt Account password>
更新本地软件包缓存
按如下步骤更新本地软件包缓存:
$ sudo apt-get update
在输出中,添加的软件源不应出现错误。
Debian 别名软件包
您可以使用别名软件包更轻松地安装内容,别名软件包只是指向实际 Debian 软件包的元软件包。
下表列出了 Debian 别名软件包的内容。
注意: 下面列出的别名包示例中使用的是 Qt 6.9.1 版本。请务必记住使用与您正在使用的 Qt 版本相匹配的软件包。有关更多信息,请参阅Qt 版本的版本库信息。
别名软件包名称 | 软件包内容 |
---|---|
qt6.9.1-essentials |
|
qt6.9.1-essentials-dev |
|
qt6.9.1-full | |
qt6.9.1-full-dev |
|
qt6.9.1-full-dbg |
Debian 安装命令示例
$ sudo apt install qt6.9.1-full-dev
完整配置示例
以下代码片段演示了 Enterprise Qt Debian 软件包的整个工作流程:
# install repository key $ sudo mkdir -p /etc/apt/keyrings/tqtc $ cd /etc/apt/keyrings/tqtc $ sudo wget https://cdn.qt.io/debian/keys/qt-company-debian-repo.gpg # configure Qt Account based authentication to Qt Debian repositories $ sudo nano /etc/apt/auth.conf machine https://debian-packages.qt.io login <your Qt Account email> password <your Qt Account password> # add repositories $ sudo nano /etc/apt/sources.list.d/tqtc.list deb [arch=arm64 signed-by=/etc/apt/keyrings/tqtc/qt-company-debian-repo.gpg] https://debian-packages.qt.io/debian/enterprise/qt6.9.1-arm64 tqtc-jammy main # add source packages $ sudo nano /etc/apt/sources.list.d/tqtc.list deb-src [signed-by=/etc/apt/keyrings/tqtc/qt-company-debian-repo.gpg] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64 tqtc-jammy main # update local package cache $ sudo apt-get update # search and install packages $ apt-cache search qt6.9.1-full-dev .... .... # files are installed under /opt/qt-6.9.1 $ sudo apt install qt6.9.1-full-dev
请参阅Qt 发行版的软件源信息,在/etc/apt/sources.list.d/tqtc.list文件中选择所需的软件源。
故障排除
身份验证困难
服务器可能会响应以下 HTTP 错误代码:
401 未授权
凭证错误。用户电子邮件和密码必须以正确格式提供。
此外,请尝试将凭据直接存储到版本库配置中:
deb [...] https://<Qt Account email>:<Qt Account passwd>@https://debian-packages.qt.io/.....
如果密码包含特殊字符,可能需要为 APT 转义。使用""或"%40 "转义这些字符,或尝试更改 Qt 账户密码。
403 禁止
缺少凭证。
429 请求过多
用户发送了太多失败请求(每分钟 3 个请求)。
500 内部服务器错误
联系Qt 支持。
版本库 GPG 密钥使用困难
除了在版本库配置中使用signed-by
使用属性外,还有一种方法可以通过以下方式安装密钥,但不推荐使用这种方法,因为这是一种已废弃的安装方式:
$ sudo apt-key add qt-company-debian-repo.gpg
Qt 版本库信息
以下是 Enterprise Qt Debian 软件包支持的 Qt 版本。请选择所需的软件源,并按上述说明将它们添加到你的/etc/apt/sources.list.d/tqtc.list中。
此外,下表列出了系统中的安装目录以及与软件包兼容的 Linux 发行版。
注意: 要访问列出的软件源,你需要一个评估版 Qt 账户或具有 Qt for Device Creation 许可证的商业版 Qt 账户。
注: 软件包也可能在其他发行版上运行,但不能保证。
Qt Creator
架构 | 发行版 | 安装目录 | APT 的软件包资源列表条目 |
---|---|---|---|
amd64 | jammy-jellyfish (Ubuntu 22.04) | /opt/qt-creator/ | deb [arch=amd64 signed-by=<path>] https://debian-packages.qt.io/debian/enterprise/qtcreator-amd64 tqtc-jammy main |
arm64 | jammy-jellyfish (Ubuntu 22.04) | /opt/qt-creator/ | deb [arch=arm64 signed-by=<path>] https://debian-packages.qt.io/debian/enterprise/qtcreator-arm64 tqtc-jammy main |
Qt 6.9.1
架构 | 安装目录 | 安装目录 | APT 的软件包资源列表条目 |
---|---|---|---|
amd64 | jammy-jellyfish (Ubuntu 22.04) | /opt/qt-6.9.1/x86_64-linux-gnu/ | deb [arch=amd64 signed-by=<path>] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-amd64 tqtc-jammy main |
arm64 | jammy-jellyfish (Ubuntu 22.04) | /opt/qt-6.9.1/aarch64-linux-gnu/ | deb [arch=arm64 signed-by=<path>] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64 tqtc-jammy main |
arm64 | 书虫 (Debian 12, GLES) | /opt/qt-6.9.1/aarch64-linux-gnu/ | deb [arch=arm64 signed-by=<path>] https://debian-packages.qt.io/debian/enterprise/qt-6.9.1-arm64-gles tqtc-bookworm main |
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.