1

I tried to upgrade my 18.04 system to 20.04 and it has resulted in a lot of problems.

Near the end of the upgrade process, the update-manager informed me that it would be a partial upgrade.

My log in screen says 19.10, but in settings is says 20.04.

I cannot open gnome-terminal or any of the software packages. My second monitor no longer works (nvidia graphics card), I cannot open "additional drivers" or install any nvidia drivers.

XTerm does work, but takes an extremely long time to open a terminal window and give me a prompt.

Whenever I try to start a program or update, I get errors about libapk-pkg.so.5.0:

Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ImportError: libapt-pkg.so.5.0: cannot open shared object file: No such file or directory
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: libapt-pkg.so.5.0: cannot open shared object file: No such file or directory

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ImportError: libapt-pkg.so.5.0: cannot open shared object file: No such file or directory
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

I have tried installing libapt-pkg, but it says it's already at the latest version.

Is there a way to finish the 'partial-upgrade' to a complete upgrade and recover my system?

Several versions of libapt-pkg are installed where they should be:

user@computer:~$ sudo updatedb && locate libapt-pkg.so
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.90
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.90.0
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0.0
JLC
  • 143
  • A "partial upgrade" is usually caused by wrong-version packages from non-Ubuntu repositories, PPAs, or wrong-release repositories. Those packages conflict with the new 20.04 packages. You have three options: Live with it broken, find and remove the conflicting packages, or do a clean-reinstall. There are advantages and disadvantages to each option - use the Search box at the top of the page to look for "Partial Upgrade". – user535733 May 16 '20 at 22:32
  • It looks like all of my PPAs were disabled. How do I find which packages are conflicting? I can't install or run anything at the moment. My browser and XTerm are all I have. – JLC May 16 '20 at 22:49
  • You can start with the error message, or you can try the Search Box (somebody answered a question like that a few months ago). – user535733 May 16 '20 at 22:50
  • Everything I try results in the the libapt-pkg5.0 error, so that seems like the root of the problem. – JLC May 16 '20 at 22:53
  • If you can't install libapt, then it's game over. Sorry. Back up your data and reinstall. Learn from your mistake: Track non-Ubuntu and wrong-version software that you install, and remove it when you're done with it. Before a release-upgrade, try to return your Ubuntu system to as close to stock condition as possible. – user535733 May 16 '20 at 22:55
  • My question is how do I install libapt – JLC May 16 '20 at 23:20
  • I have several installed: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.90 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.90.0 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0. – JLC May 17 '20 at 00:13
  • How do you install libapt without using apt? You can get it from http://packages.ubuntu.com and install it using dpkg instead of apt. It might work. However, be prepared for rough going: If it were easy. apt would have installed it with your partial upgrade. – user535733 May 17 '20 at 01:45

0 Answers0