ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu20.04.3安装Qt6.22操作步骤

2022-04-22 11:03:40  阅读:244  来源: 互联网

标签:ubuntu20.04 Qt6.22 enable -- com apt aliyun ubuntu 操作步骤


镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

前言

Qt6.22LTS版本正式推出了,刚好有个项目,使用的linux屏资源比较好,准备使用Qt6.22,记录下在ubuntu20.04.3下安装Qt6.22的步骤

一、安装步骤

1.安装ubuntu20.04.3

直接到ubuntu网站,下载该安装镜像,在虚拟机下安装即可

2.更新ubuntu镜像下载源

2.1 修改 sources.list文件

不要使用ubuntu桌面的设置来设置为国内下载源,直接修改/etc/apt/sources.list文件

使用 sudo gedit /etc/apt/sources.list打开该文件

删除文件内所有内容后,使用阿里云镜像

# 阿里云镜像
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

2.2 更新操作

在终端内运行

sudo apt update
sudo apt upgrade

若执行 sudo apt upgrade 提示以下错误,是因为某个进程锁住了文件,我是直接重启后再upgrade,或参考其他方法,杀死进程,删除导致锁定的文件

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend xxxx

3.替换系统的vim

ubuntu自带的vim是tiny版,经常会有奇怪的字符,替换系统自带的vim

sudo apt remove vim-common
sudo apt install vim

4. 安装ifconfig支持

ubuntu默认没有安装ifconfig,需要手动安装

sudo apt install net-tools

5.安装sshd

ubuntu默认没有安装sshd,需要手动安装

sudo apt install openssh-server

6.安装gcc编译器

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

安装完毕后,控制台输入gcc -v查看版本号,我的是9.4

root@ubuntu:/opt# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-yTrUTS/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04) 

注:安装libgl1-mesa-dev,避免Qt在编译工程时出现

/usr/bin/ld: cannot find -lGL错误

7.安装Qt

在ubuntu中打开浏览器,到Qt官网 https://www.qt.io/download

阿里云镜像源:https://developer.aliyun.com/mirror/qt

file

下载(需登录)Qt的在线安装程序 qt-unified-linux-x64-4.2.0-online.run

本文转自:https://blog.csdn.net/sonicss/article/details/121802956

标签:ubuntu20.04,Qt6.22,enable,--,com,apt,aliyun,ubuntu,操作步骤
来源: https://www.cnblogs.com/helong-123/p/16177912.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有