E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系
很可能是ubuntu更换软件源出了问题。
问题在于软件源设置不对, 装好Linux后,人们都会去修改/etc/apt/sources.list文件,在网站去搜索一个list文件换上,将软件包下载源改为国内源,而没有注意到Codename(版本别名)的影响,Ubuntu不同版本,所使用的软件源是不一样的!
正确的更换apt源的步骤如下:
查看Ubuntu的版本号和代号 lsb_release -a
root@ubuntu/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
可见装的是20.04.4 focal版
修改sources.list
sudo gedit /etc/apt/sources.list
发现问题的软件源是trusty 版 ,而本机实际是 focal版
#阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
然后将$Codename替换为你刚才查到的版本代号
deb http://mirrors.aliyun.com/ubuntu/ $Codename main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main restricted universe
更新apt缓存
sudo apt update
ubuntu更换软件源方法
用 lsb_release -c 命令查看ubuntu版本代号:
ubuntu 12.04 代号为precise
ubuntu 14.04 代号为trusty
ubuntu 15.04 代号为vivid
ubuntu 15.10 代号为wily
ubuntu 16.04 代号为xenial
ubuntu18.04 代号为bionic
如果拷贝别人的sources.list文件,对应的ubuntu版本和你的系统不一样,就出错了
最好的方法就是只改动url部分,sources.list中,
改为阿里云的镜像节点URL就行了:http://mirrors.aliyun.com/ubuntu/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)