![Ubuntu 从 18.04 升级到 20.04 后出现 Python 软件包错误](https://linux22.com/image/947741/Ubuntu%20%E4%BB%8E%2018.04%20%E5%8D%87%E7%BA%A7%E5%88%B0%2020.04%20%E5%90%8E%E5%87%BA%E7%8E%B0%20Python%20%E8%BD%AF%E4%BB%B6%E5%8C%85%E9%94%99%E8%AF%AF.png)
我已使用此命令“sudo do-release-upgrade”将我的 Ubuntu Server OS 从 18.04 升级到 20.04。
升级期间,由于网络问题下载软件包时出现一些问题。
总之,我的服务器已升级。
但在升级操作系统后,升级软件包时出现了一些严重错误。
由于某种原因,python 2 软件包损坏了。
错误如下。
root@myserver:~# apt upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python-asn1crypto : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-bs4 : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-cairo : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-certifi : Depends: python (< 2.8)
Depends: python (>= 2.7)
Depends: python:any (>= 2.6.6-7~)
python-cffi-backend : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7~)
python-chardet : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-crypto : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-cryptography : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-dbus : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
Recommends: python-gi but it is not installed
python-dnspython : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-enum34 : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-gobject-2 : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-greenlet : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7~)
python-html5lib : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-idna : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-ipaddress : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-lockfile : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-lxml : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-olefile : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-openssl : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-passlib : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-pil : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-pkg-resources : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-psutil : Depends: python (< 2.8)
Depends: python (>= 2.7~)
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-pyasn1 : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-pyasn1-modules : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-reconfigure : Depends: python (>= 2.6)
python-requests : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-six : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-support : Depends: python (>= 2.5)
Depends: python-minimal but it is not installable
python-urllib3 : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python-webencodings : Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
python2-minimal : Depends: python2.7-minimal (>= 2.7.17~rc1-1~) but it is not installed
Recommends: python2 but it is not installed
ubuntu-minimal : Depends: sudo
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
现在,我无法以非 root 用户身份运行“sudo”命令。
Command 'sudo' not found, but can be installed with:
apt install sudo # version 1.8.31-1ubuntu1.2, or
apt install sudo-ldap # version 1.8.31-1ubuntu1.2
因此,我尝试使用 root 用户执行命令“apt install sudo”,但仍然显示相同的错误。
我尝试从高级启动菜单执行 dpkg 恢复,但没有任何变化。
在我看来,python 包存在问题。
请帮助我。