前言:按照網上換源的方法出現:Unable to correct problems, you have held broken packages
一、查看系統Codename:
lsb_release -a
或者
cat /etc/apt/sources.list
二、確認阿里源支持:登陸以下網頁:http://mirrors.aliyun.com/ubuntu/dists/
三、更換源
sudo mv sources.list sources.list_bak
sudo vi sources.list
以下內容:注意,每一行的bionic應該用第一步查看得到的Codename來代替
deb http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
四、更新
更新源
sudo apt-get update
修復損壞的包,重新安裝正確版本
sudo apt-get -f install
更新軟件
sudo apt-get upgrade