0

Ubuntu 16.04.5 LTS

I want to upgrade to newer Ubuntu and newer OpenSSH, but it is failing. Any ideas how to get past this?

do-release-upgrade

Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 11, in <module>
    from UpdateManager.Core.MetaRelease import MetaReleaseCore
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7_ version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7_ version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

Original exception was: Traceback (most recent call last): File "/usr/bin/do-release-upgrade", line 11, in <module> from UpdateManager.Core.MetaRelease import MetaReleaseCore File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module> import apt File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in <module> import apt_pkg ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7 version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

sudo apt update

Hit:1 http://azure.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Fetched 163 kB in 0s (618 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
423 packages can be upgraded. Run 'apt list --upgradable' to see them.

sudo apt upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 grub-pc : Depends: grub-common (= 2.02-2ubuntu8.21) but 2.02~beta2-36ubuntu3.18 is installed
 grub-pc-bin : Depends: grub-common (= 2.02-2ubuntu8.21) but 2.02~beta2-36ubuntu3.18 is installed
 grub2-common : Depends: grub-common (= 2.02-2ubuntu8.21) but 2.02~beta2-36ubuntu3.18 is installed
 libpython2.7-stdlib : Depends: libreadline7 (>= 7.0~beta) but it is not installed
 libpython3.6-stdlib : Depends: libreadline7 (>= 7.0~beta) but it is not installed
 python-apt : Depends: libapt-inst2.0 (>= 1.6.5~) but 1.2.27 is installed
              Depends: libapt-pkg5.0 (>= 1.6.5~) but 1.2.27 is installed
 python3-apt : Depends: libapt-inst2.0 (>= 1.6.5~) but 1.2.27 is installed
               Depends: libapt-pkg5.0 (>= 1.6.5~) but 1.2.27 is installed
 python3-cryptography : Depends: python3-asn1crypto (>= 0.21.0~) but it is not installed
                        Depends: python3-idna (>= 2.1) but 2.0-3 is installed
 python3-gdbm : Depends: libgdbm5 (>= 1.14) but it is not installed
 python3-newt : Depends: libnewt0.52 (= 0.52.20-1ubuntu1) but 0.52.18-1ubuntu2 is installed
 systemd : Depends: libsystemd0 (= 229-4ubuntu21.2) but 237-3ubuntu10.44 is installed
 udev : Depends: libudev1 (= 229-4ubuntu21.2) but 237-3ubuntu10.44 is installed
E: Unmet dependencies. Try using -f.

sudu apt-get -f install

Traceback (most recent call last):
  File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module>
    from _gdbm import *
ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module> import dbm.gnu as gdbm File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module> raise ImportError(str(msg) + ', please install the python3-gdbm package') ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory, please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/command-not-found", line 27, in <module> from CommandNotFound.util import crash_guard File "/usr/lib/python3/dist-packages/CommandNotFound/init.py", line 3, in <module> from CommandNotFound.CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module> import gdbm ModuleNotFoundError: No module named 'gdbm' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in <module> from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module> import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module> from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module> import apt File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in <module> import apt_pkg ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7 version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

Original exception was: Traceback (most recent call last): File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module> from _gdbm import * ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module> import dbm.gnu as gdbm File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module> raise ImportError(str(msg) + ', please install the python3-gdbm package') ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory, please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/command-not-found", line 27, in <module> from CommandNotFound.util import crash_guard File "/usr/lib/python3/dist-packages/CommandNotFound/init.py", line 3, in <module> from CommandNotFound.CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module> import gdbm ModuleNotFoundError: No module named 'gdbm'

sudu apt list --upgradable

Traceback (most recent call last):
  File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module>
    from _gdbm import *
ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module> import dbm.gnu as gdbm File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module> raise ImportError(str(msg) + ', please install the python3-gdbm package') ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory, please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/command-not-found", line 27, in <module> from CommandNotFound.util import crash_guard File "/usr/lib/python3/dist-packages/CommandNotFound/init.py", line 3, in <module> from CommandNotFound.CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module> import gdbm ModuleNotFoundError: No module named 'gdbm' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in <module> from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module> import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module> from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module> import apt File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in <module> import apt_pkg ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol ZN13debListParser12ParseDependsEPKcS1_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RjRKbSB_SB_RKS7 version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

Original exception was: Traceback (most recent call last): File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module> from _gdbm import * ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module> import dbm.gnu as gdbm File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module> raise ImportError(str(msg) + ', please install the python3-gdbm package') ImportError: libgdbm.so.5: cannot open shared object file: No such file or directory, please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/command-not-found", line 27, in <module> from CommandNotFound.util import crash_guard File "/usr/lib/python3/dist-packages/CommandNotFound/init.py", line 3, in <module> from CommandNotFound.CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module> import gdbm ModuleNotFoundError: No module named 'gdbm'

r4v3n6
  • 33
  • 1
    You cannot upgrade 16.04 directly to 20.04. You first need to reach 18.04 and then 20.04. Amid this, you'll definitely lose Unity as 18.04 uses GNOME. – graham Feb 19 '21 at 18:55
  • 5
    Those are 18.04 (Bionic) sources, so perhaps you have already done a partial upgrade. To repair may be possible, but will be tedious and lengthy as you chase down every error. To backups your data and clean-install 20.04 is much faster and easier, but less of a learning challenge. – user535733 Feb 19 '21 at 19:02
  • 1
    It is not clear to me at all where you are, you say 16.04.5 but I see bionic sources??? You need to fully-upgrade first on xenial ie. to 16.04.7 before upgrade should be performed? but that won't result in bionic as you've shown them. The python errors imply to me you've changed your python, or attempted to upgrade Ubuntu as if it's Debian (ie. amended sources) which can create python problems as Ubuntu != Debian (upgrade tools add a strict order to avoid python issues, plus other things..) I see out-dated xenial packages in your messages so do-release-upgrade shouldn't be run yet – guiverc Feb 19 '21 at 22:23
  • Thanks. I have already installed new 18/20 versions, so I will probably give up this. It was originally older v13 upgraded to v14 and later v16. The only thing I really added to this machine is ProFtpd as I test different SFTP servers. I would prefer to keep it as ProFtpd setup was lengthy. I saved the conf files now so hopefully able to re-use those on other machine. ProFtpd install: sudo apt-get update && sudo apt-get install proftpd I have done these to upgrade in the past: sudo apt-get update && sudo apt-get upgrade do-release-upgrade

    but now it seems stuck in dependency bad "loop"

    – r4v3n6 Feb 22 '21 at 21:10
  • 1
    18/20 version? Ubuntu has since 2016 referred to snap only systems using the year format, to distinguish them from the year.month format (eg. 18.04) used by deb based systems. They are different products , so no 16.04 system should be upgraded to Ubuntu Core 18/Ubuntu Core 20. v13? v14? Ubuntu only started using the yy format in 2016 so no such releases ever existed (the yy.mm format releases occur at least twice per year [more if you count re-spins so yy makes no sense for those product). Please be precise in your questions for meaningful help. – guiverc Feb 22 '21 at 23:58
  • 1
    Sorry if unclear. With 18/20, I meant two different servers with 18.04 and 20.04. I now also have other 22.04 installation as well. All working fine now for my basic usage. Thanks all. – r4v3n6 Sep 13 '23 at 18:27

0 Answers0