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

然后可以正常安装了。

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

相关推荐
阿华hhh5 分钟前
项目(购物商城)
linux·服务器·c语言·c++
摸鱼仙人~13 分钟前
大模型文章生成的风格个性化与多文体写作:一套可落地的方法论
linux·运维·服务器
煤球王子17 分钟前
浅学文件系统4(页面缓存)
linux
peixiuhui21 分钟前
Iotgateway技术手册-1. 项目概述
linux·网关·iot·modbus·数据采集网关·iotgateway·采集软件
wdfk_prog22 分钟前
[Linux]学习笔记系列 -- [fs]sysfs
linux·笔记·学习
AllFiles33 分钟前
Linux 网络故障排查:如何诊断与解决 ARP 缓存溢出问题
linux·后端
pps-key1 小时前
Afrog漏洞扫描器:从入门到入狱......边缘的摇摆记录(pps-key黑化版)
linux·计算机网络·安全·网络安全
学Linux的语莫1 小时前
linux的root目录缓存清理
linux·运维·服务器
oMcLin1 小时前
如何在 SUSE Linux Enterprise Server 15 上部署并优化 K3s 集群,提升轻量级容器化应用的资源利用率?
linux·运维·服务器
L_09072 小时前
【Linux】进程概念
linux