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

然后可以正常安装了。

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

相关推荐
i建模35 分钟前
如何在Arch Linux中重设忘记的root密码
linux·运维·服务器
kida_yuan2 小时前
【Linux】运维实战笔记 — 我常用的方法与命令
linux·运维·笔记
@syh.2 小时前
【linux】进程控制
linux
何中应4 小时前
vmware的linux虚拟机如何设置以命令行方式启动
linux·运维·服务器
江畔何人初4 小时前
kubernet与docker的关系
linux·运维·云原生
百炼成神 LV@菜哥4 小时前
Kylin Linux V10 aarch64 安装启动 TigerVNC-Server
linux·服务器·kylin
佑白雪乐5 小时前
<Linux基础11集>电流+二极管+晶体管+存储器
linux
嵌入式郑工5 小时前
RK3566 LubanCat 开发板 USB Gadget 配置完整复盘
linux·驱动开发·ubuntu
one____dream5 小时前
【网安】Reverse-非常规题目
linux·python·安全·网络安全·ctf
j_xxx404_5 小时前
Linux:进程程序替换
linux·运维·服务器