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

然后可以正常安装了。

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

相关推荐
M4K03 小时前
Linux百度网盘优化三板斧
linux
好奇的菜鸟3 小时前
如何在 Ubuntu 24.04 (Noble) 上使用阿里源
linux·运维·ubuntu
bcbobo21cn3 小时前
初步了解Linux etc/profile文件
linux·运维·服务器·shell·profile
望获linux4 小时前
【实时Linux实战系列】CPU 隔离与屏蔽技术
java·linux·运维·服务器·操作系统·开源软件·嵌入式软件
0wioiw04 小时前
C#基础(项目结构和编译运行)
linux·运维·服务器
2401_873587825 小时前
Linux常见指令以及权限理解
linux·运维·服务器
Arthurmoo5 小时前
Linux系统之MySQL数据库基础
linux·数据库·mysql
好奇的菜鸟5 小时前
如何在Ubuntu上检查MySQL是否启动并放开3306端口
mysql·ubuntu·adb
李洋-蛟龙腾飞公司6 小时前
HarmonyOS NEXT应用元服务常见列表操作分组吸顶场景
linux·运维·windows
链上Sniper6 小时前
智能合约状态快照技术:实现 EVM 状态的快速同步与回滚
java·大数据·linux·运维·web3·区块链·智能合约