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

然后可以正常安装了。

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

相关推荐
瑾珮15 小时前
nmcli命令网络配置
linux·网络
qq_4204432715 小时前
AMD显卡在windows中通过WSL安装使用stable diffusion(WebUI和ComfyUI)
linux·windows·ubuntu·stable diffusion·wsl
无事好时节15 小时前
Linux 进程管理
linux
试着15 小时前
【VSCode+AI+测试】连接ai大模型
ide·人工智能·vscode·python·学习·编辑器·ai-test
程序员zgh15 小时前
CMake 项目构建工具介绍
c语言·开发语言·c++·编辑器
RisunJan15 小时前
Linux命令-grep命令(文本搜索工具)
linux·运维·服务器
ydswin16 小时前
Keepalived详解:原理、编译安装与高可用集群配置
linux
水天需01016 小时前
Vim 分屏操作详解
linux
电子小子洋酱16 小时前
Linux显示设备驱动开发 Drm驱动&&Makefile
linux·驱动开发·笔记
huangyuchi.16 小时前
【Linux 网络】理解并应用应用层协议:HTTP(附简单HTTP服务器C++代码)
linux·服务器·网络·网络协议·http·c/c++