Ubuntu安装软件报错E Unable to correct problems, you have held broken packages

Ubuntu安装软件报错E: Unable to correct problems, you have held broken packages

问题

sudo apt install时报错E: Unable to correct problems, you have held broken packages

原因

Ubuntu 版本跟apt源不匹配,使用最新的源即可,本文使用阿里源。

解决方法

查看版本信息

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal

换源

sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
:wq
$ sudo apt update
$ sudo apt-get upgrade

成功:此时再sudo apt install 软件名即可!!!

猜你喜欢

转载自blog.csdn.net/qq_40342400/article/details/128245492