https://mirror.tuna.tsinghua.edu.cn/help/ubuntu-ports/
传统格式(/etc/apt/sources.list)
Ubuntu 版本
Ubuntu 24.04 LTS
启用源码源
启用 proposed
强制安全更新使用镜像
``
默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-backports main restricted universe multiverse
以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse
预发布软件源,不建议启用
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-proposed main restricted universe multiverse
``
更新系统软件包列表:
bash
sudo apt update
sudo apt upgrade
安装必要的构建工具和基础库:
bash
sudo apt install build-essential libgl1-mesa-dev
这一步安装了编译Qt应用程序所需的基础工具和OpenGL库。
安装Qt核心开发库和工具:
bash
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
qtbase5-dev 是Qt 5的核心开发库,qt5-qmake 是项目构建工具。
(可选)安装Qt Creator集成开发环境:
bash
sudo apt install qtcreator
安装后,你可以在应用程序菜单中找到它。
(可选)安装额外模块:
根据你的项目需要,可以选择安装其他模块,例如:
bash
如果需要开发图形界面应用
sudo apt install qtdeclarative5-dev
如果需要串口通信功能
sudo apt install libqt5serialport5-dev