Ubuntu20.04安装软件报错:The following packages have unmet dependencies

Ubuntu20.04更换阿里云源后安装软件都会报错:The following packages have unmet dependencies

查看资料,大概是ubuntu本身的源比较版本较老,而阿里云的源比较新,因此版本不匹配造成依赖的库不匹配,所以只要将阿里云的源换回Ubuntu官方源

1,替换源

Ubuntu 的软件源配置文件是 /etc/apt/sources.list

使用指令:

python 复制代码
sudo vim /etc/apt/sources.list

然后将下面的源拷贝过去:

Ubuntu20.04LTS的清华大学源如下:

python 复制代码
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
 
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

如下所示:

2,更新源

更新本地软件源列表:

python 复制代码
sudo apt-get update

根据刚才更新的软件源更新本地软件库:

python 复制代码
sudo apt-get upgrade

然后可以正常安装了。

如果还是不能解决你的问题,有可能是其他的问题。可以再搜搜。

相关推荐
the_fat_bird4 分钟前
ubuntu install nvidia gpu driver
linux·运维·ubuntu
IMPYLH22 分钟前
Linux 的 tac 命令
linux·运维·服务器·bash
计算机安禾26 分钟前
【Linux从入门到精通】第50篇:专栏总结与Linux学习之路的未来展望
linux·运维·学习
zhouwy11327 分钟前
Linux 内核学习笔记:从零搭建内核开发与调试环境
linux
GottdesKrieges33 分钟前
OceanBase备份常见问题
linux·网络·oceanbase
白菜欣1 小时前
Linux —进程概念
linux·运维·服务器
iuu_star1 小时前
Vue+FastAPI 项目宝塔Linux部署指南
linux·运维·fastapi
skilllite作者1 小时前
Zed 1.0 编辑器深度评测与实战指南
开发语言·人工智能·windows·python·编辑器·agi
楼田莉子1 小时前
仿Muduo的高并发服务器:Channel模块与Poller模块
linux·服务器·c++·学习·设计模式
zhouwy1131 小时前
Linux网络编程从入门到精通
linux·c++