本页内容

适用于 Linux 的 Qt

Qt 对各种 Linux 平台的支持既广泛又成熟。

要下载并安装 Linux 版Qt,请按照“Qt 入门”页面上的说明操作。您也可以使用发行版的包管理器安装 Qt;有关更多信息,请参阅《Linux 版 Qt 的其他安装方法》。

支持的配置

支持以下配置。

发行版体系结构编译器备注
Red Hat™ 9.6x86_64GCC 11
Red Hat 10.0x86_64GCC 14
openSUSE 16.0x86_64GCC 15
SUSE Linux Enterprise Server 15 SP6x86_64GCC 11
Ubuntu 22.04x86_64Canonical 提供的 GCC,GCC 11.x另请参阅:Enterprise Qt Debian 软件包。
Ubuntu 24.04x86_64, arm64Canonical 提供的 GCC,GCC 13.x请参阅关于 Arm 架构下 Linux 桌面支持的说明。
Debian 11.6x86_64, arm64GCC 10请参阅关于 Linux on Arm 桌面支持的说明。
Debian 12x86_64, arm64GCC 12另请参阅:企业版 Qt Debian 软件包。

请参阅关于 Arm 架构上 Linux 桌面支持的说明。

注意:对于基于 Arm 的 Linux 桌面系统,我们使用配备 8GB 内存的 Raspberry Pi 5 及 Ubuntu 24.04 作为参考平台。如果您在其他硬件上遇到问题,请尝试在 Raspberry Pi 5 上复现该问题。 我们计划在更多基于 ARM 的桌面硬件问世后,转为常规平台支持。Qt Online Installer 中的官方二进制文件是在 Ubuntu 24.04 上构建的,该系统自带 glibc 2.39;如果您的 glibc 版本早于我们构建时使用的版本,则需要从源代码重新编译。

开发主机的要求

Linux 版的 Qt 安装程序默认假设主机操作系统已提供 C++ 编译器、调试器、make 以及其他开发工具。此外,构建图形化 Qt 应用程序还需要满足Qt for Linux - Requirements 中的要求,并安装 OpenGL 库和头文件。 大多数 Linux 发行版默认不会安装所有这些组件,但设置开发环境仍然非常简单。

请使用以下命令安装构建 Qt 应用程序所需的基本组件:

Debian/Ubuntu (apt-get)

sudo apt-get install build-essential libgl1-mesa-dev

Fedora/RHEL/CentOS (yum)

sudo yum groupinstall "C Development Tools and Libraries"
sudo yum install mesa-libGL-devel

openSUSE (zypper)

sudo zypper install -t pattern devel_basis

支持的 Glibc 版本

Qt 安装程序以及 Qt Installer Framework 的组件和工具均基于特定的 glibc 版本构建,因此无法在 glibc 版本较旧的系统上运行。

Qt 发行版所需的 glibc 版本
Qt 6.8+glibc 2.28+
Qt 6.10 及以上glibc 2.34 及以上版本

注意:如果您 从源代码编译 Qt,则 glibc 版本没有限制。

从源代码编译 Qt

您还可以从源代码包构建 Qt,并根据目标平台进行配置。源代码包可从http://www.qt.io/download/ 获取。

下面将为您提供有关从源代码构建 Qt 的更多信息。

部署及其他问题

以下页面介绍了开发 Linux/X11 应用程序时需要注意的具体问题及相关建议。

下一步该怎么做

我们诚邀您进一步探索 Qt 的其他功能。我们准备了概述文档,帮助您决定使用哪些 API;同时,我们的示例代码将向您展示如何使用这些 API。

Qt 充满活力且活跃的社区网站https://www.qt.io汇集了维基、论坛以及其他学习指南和演示资料。

© 2026 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.