系统:ubuntu 20.04
报错:Unable to correct problems, you have held broken packages
#查看Codename字段
lsb_release -a
root@master02-12:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
#对比ubuntu各个版本的源:
Ubuntu 12.04 (LTS)代号为precise。
Ubuntu 14.04 (LTS)代号为trusty。
Ubuntu 15.04 代号为vivid。
Ubuntu 15.10 代号为wily。
Ubuntu 16.04 (LTS)代号为xenial。
Ubuntu 18.04 (LTS)代号为bionic。
Ubuntu 20.04 (LTS)代号为focal。
#测试一下源
sudo apt update
root@master02-12:~# sudo apt update
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Hit:6 http://download.zerotier.com/debian/bionic bionic InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
检测字段为bionic,不对,切换成默认源
/etc/apt/sources.list
deb http://cn.archive.ubuntu.com/ubuntu focal main restricted
deb http://cn.archive.ubuntu.com/ubuntu focal-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu focal universe
deb http://cn.archive.ubuntu.com/ubuntu focal-updates universe
deb http://cn.archive.ubuntu.com/ubuntu focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu focal-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu focal-security main restricted
deb http://cn.archive.ubuntu.com/ubuntu focal-security universe
deb http://cn.archive.ubuntu.com/ubuntu focal-security multiverse
#再测试一下源
sudo apt update
root@master01-11:~# sudo apt update
Get:1 http://cn.archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Hit:2 http://download.zerotier.com/debian/bionic bionic InRelease
Get:3 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
最后发现源的字段对上了
结论:就是源的问题