问题描述:
一、问题原因:换源错误!
我的ubuntu版本和源版本不一致
# 1.查看sources.list/etc/apt/sources.list# 2.查看ubuntu版本sudo lsb_release -a# 3.对于 Ubuntu 20.04 (focal):deb http://mirrors.cqu.edu.cn/ubuntu/ focal main restricted universe multiverse# deb-src http://mirrors.cqu.edu.cn/ubuntu/ focal main restricted universe multiversedeb http://mirrors.cqu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse# deb-src http://mirrors.cqu.edu.cn/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.cqu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse# deb-src http://mirrors.cqu.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb http://mirrors.cqu.edu.cn/ubuntu/ focal-security main restricted universe multiverse# deb-src http://mirrors.cqu.edu.cn/ubuntu/ focal-security main restricted universe multiverse# deb http://mirrors.cqu.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse# deb-src http://mirrors.cqu.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse# 4.换源,将上面源的复制到以下文件中vim /etc/apt/sources.list# 5.更新缓存和软件包sudo apt updatesudo apt upgrade
二、安装apt
# 1. 到镜像站找到对应的apt版本,下载到本地wget http://mirrors.163.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.24_amd64.deb # 2. 安装sudo dpkg -i apt_1.0.1ubuntu2.24_amd64.deb# 3. 更新sudo apt updatesudo apt upgrade
这样就能正常运行了。
来源地址:https://blog.csdn.net/qq_52787609/article/details/127173886