Ubuntu 18.04安装Qt开发环境异常解决办法

近期需要在Ubuntu 18.04系统下用到Qt5.15开发环境,按照网上的资料在线安装,

  1. 进入root用户,并下载qt-unified-linux-x64-online.run
book@100ask:~/glen_imx6ul_linux$ sudo wget https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
[sudo] password for book: 
--2023-03-28 17:38:25--  https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
Resolving download.qt.io (download.qt.io)... 77.86.162.2
Connecting to download.qt.io (download.qt.io)|77.86.162.2|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://mirrors.ustc.edu.cn/qtproject/archive/online_installers/4.5/qt-unified-linux-x64-4.5.2-online.run [following]
--2023-03-28 17:38:28--  https://mirrors.ustc.edu.cn/qtproject/archive/online_installers/4.5/qt-unified-linux-x64-4.5.2-online.run
Resolving mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)... 202.141.176.110, 2001:da8:d800:95::110
Connecting to mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)|202.141.176.110|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 57561126 (55M) [application/x-makeself]
Saving to: ‘qt-unified-linux-x64-online.run’

qt-unified-linux-x6 100%[===================>]  54.89M  6.50MB/s    in 8.7s    

2023-03-28 17:38:38 (6.30 MB/s) - ‘qt-unified-linux-x64-online.run’ saved [57561126/57561126]
  1. qt-unified-linux-x64-online.run更改为可执行
book@100ask:~/glen_imx6ul_linux$ ls
qt-unified-linux-x64-online.run
book@100ask:~/glen_imx6ul_linux$ sudo chmod +x qt-unified-linux-x64-online.run 
  1. 安装qt-unified-linux-x64-online.run
root@100ask:/home/book/glen_imx6ul_linux# ./qt-unified-linux-x64-online.run

总是中途停止并提示类似如下信息(重试N次都没用):

https://mirrors.aliyun
com/gtproject/online/gtsdkrepository/windows-x86/android/qt6
624/2022-03-14-1134 meta.7z Error transferring https://mirrors.
aliyun. com/qtproject/online/gtsdkrepository/window5 x86/android/gt6
624/2022-03-14-1134 meta. 7z - server replied: NOT Found

  1. 参考网友的解决办法Qt 在线安装失败
    4.1 把ubuntu 18.04软件源替换成官方源
root@100ask:/home/book/glen_imx6ul_linux#  vim /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

4.2 更新软件源(这一步非必要)

root@100ask:/home/book/glen_imx6ul_linux# apt install update

4.3 指定软件源IP地址
执行下面命令重新安装

root@100ask:/home/book/glen_imx6ul_linux# ./qt-unified-linux-x64-online.run https://mirrors.cnnic.cn/qt/

按自己需求选择安装完成。

  1. 打开QtCreator
root@100ask:/home/book/glen_imx6ul_linux# /opt/Qt/Tools/QtCreator/bin/qtcreator.sh &
[1] 6096
root@100ask:/home/book/glen_imx6ul_linux# /opt/Qt/Tools/QtCreator/bin/qtcreator: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6)

提示以上错误,并无法继续打开
参考Ubuntu 18.04 出现GLIBC_2.28 not found的解决方法
5.1 执行以下命令更改软件源

root@100ask:/home/book/glen_imx6ul_linux# vim /etc/apt/sources.list

增加这一行,保存并退出

deb http://security.debian.org/debian-security buster/updates main

5.2 更新软件源

root@100ask:/home/book/glen_imx6ul_linux# sudo apt update 

5.3 查看ubuntu 18.04 glibc当前版本
执行命令

root@100ask:/home/book/glen_imx6ul_linux# strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_

返回

GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28
GLIBC_PRIVATE

出现了GLIBC_2.28,意味着更新成功了。
再次执行root@100ask:/home/book/glen_imx6ul_linux# /opt/Qt/Tools/QtCreator/bin/qtcreator.sh &命令即可打开Qt开发环境了
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值