ubuntu20.04 apt 安装报 E: Unable to correct problems, you have held broken packages.
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了ubuntu20.04 apt 安装报 E: Unable to correct problems, you have held broken packages.,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2926字,纯文字阅读大概需要5分钟。
内容图文
在安装软件的时候报错:
root@root:-$sudo apt-get install vim
Reading package lists... Done
Building dependency tree ? ? ??
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
?vim : Depends: vim-common (= 2:8.0.1453-1ubuntu1) but 2:8.0.1453-1ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.
网上查询了很多资料,都无法解决,
设置--软件更新不行
sudo apt-get install aptitude 也不可以
最后发现是我的apt源的问题,切换的国内源不可用,你可以先执行 lsb_release -a 查看到是Codename: focal类型的源,所以需要切换的国内源是这样的:
sudo gedit /etc/apt/sources.list
#清华源
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
原来报错的源是:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
看看是不是不一样,切换focal的源在更新就没问题了。
内容总结
以上是互联网集市为您收集整理的ubuntu20.04 apt 安装报 E: Unable to correct problems, you have held broken packages.全部内容,希望文章能够帮你解决ubuntu20.04 apt 安装报 E: Unable to correct problems, you have held broken packages.所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。