Python Package Error After Upgrading Ubuntu From 18.04 To 20.04

Viewed 148

I have upgraded my Ubuntu Server OS to 20.04 from 18.04 with this command "sudo do-release-upgrade".
While upgrading, there was some problems with downloading packages for network problem.
Anyhow, my server has been upgraded.

But after upgrading OS, there was some critical errors while upgrading packages.
For some reason, python 2 packages are broken.

The errors are below.

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).

In now, I can't run "sudo" command with non root user.

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

So I have tried the command "apt install sudo" with root user, but same errors are shown.
In my opinion, there was any problems with python packages.
Please help me.

0 Answers
Related