I am trying to upgrade from 18.04 to 20.04:
$ grep -i rel /etc/lsb-release
DISTRIB_RELEASE=20.04
It looks like there is a dependency issue:
$ sudo apt-get update
Hit:1 http://no.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://no.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://no.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
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.6.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 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: libapt-pkg.so.6.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.6.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 seems I have the old libapt-pkg.so.5.0 instead of the new and expected libapt-pkg.so.6.0:
sudo updatedb && locate libapt-pkg.so
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0.2
Any hints on how to repair?
Update after helpful hints from MAV:
$ wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg6.0_2.0.2ubuntu0.1_amd64.deb
$ sudo dpkg -i libapt-pkg6.0_2.0.2ubuntu0.1_amd64.deb
$ sudo apt-get update
Reading package lists... Done
$ sudo apt-get upgrade
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:
<..lot of packages..>
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
gir1.2-gdkpixbuf-2.0 : Breaks: gir1.2-gdkpixbuf-2.0:i386 (!= 2.36.11-2) but 2.40.0+dfsg-3 is installed
gir1.2-gdkpixbuf-2.0:i386 : Depends: gir1.2-glib-2.0:i386 (>= 0.9.3) but it is not installed
Depends: libgdk-pixbuf2.0-0:i386 (>= 2.39.2) but it is not installed
Breaks: libgtk3-perl (< 0.034-2~) but 0.032-1 is installed
Breaks: gir1.2-gdkpixbuf-2.0 (!= 2.40.0+dfsg-3) but 2.36.11-2 is installed
gir1.2-gtk-3.0 : Depends: gir1.2-gdkpixbuf-2.0 (>= 2.40.0) but 2.36.11-2 is installed
Depends: gir1.2-pango-1.0 (>= 1.41.0) but 1.40.14-1ubuntu0.1 is installed
Depends: libgtk-3-0 (>= 3.24.7) but 3.22.30-1ubuntu4 is installed
gnupg : Depends: gpgv (>= 2.2.19-3ubuntu2)
hplip : Depends: hplip-data (= 3.20.3+dfsg0-2) but 3.17.10+repack0-5 is installed
Depends: libhpmud0 (= 3.20.3+dfsg0-2) but 3.17.10+repack0-5 is installed
Depends: printer-driver-hpcups (= 3.20.3+dfsg0-2) but 3.17.10+repack0-5 is installed
libsane-hpaio : Depends: libhpmud0 (>= 3.20.3+dfsg0) but 3.17.10+repack0-5 is installed
python3-brlapi : Depends: libbrlapi0.7 but it is not installed
python3-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but 3.6.7-1~18.04 is installed
Depends: python3.8-dev (>= 3.8.2-1~) but it is not installed
python3-gi : Depends: libgirepository-1.0-1 (>= 1.62.0-4~) but 1.56.1-1 is installed
python3-pil : Depends: libimagequant0 (>= 2.11.10) but it is not installed
python3-protobuf : Depends: libprotobuf17 but it is not installed
python3-uno : Depends: libreoffice-core (= 1:6.4.3-0ubuntu0.20.04.1) but 1:6.0.7-0ubuntu0.18.04.10 is installed or
libreoffice-core-nogui (= 1:6.4.3-0ubuntu0.20.04.1) but it is not installed
Depends: libuno-cppu3 (>= 4.4.0~alpha) but it is not installed
Depends: libuno-cppuhelpergcc3-3 (>= 5.3.0~alpha) but it is not installed
Depends: libuno-sal3 (>= 5.4.0~alpha) but it is not installed
Depends: libuno-salhelpergcc3-3 (>= 3.6.0~beta) but it is not installed
Depends: uno-libs-private but it is not installed
rhythmbox-plugins : Depends: librhythmbox-core10 (= 3.4.4-1ubuntu2) but 3.4.2-4ubuntu1 is installed
Depends: rhythmbox (= 3.4.4-1ubuntu2) but 3.4.2-4ubuntu1 is installed
Depends: gir1.2-rb-3.0 (= 3.4.4-1ubuntu2) but 3.4.2-4ubuntu1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
$
So I guess I can manually upgrade and/or purge packages now?
I assume your arch is amd64.
Try
cd /tmp;wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg6.0_2.0.2ubuntu0.1_amd64.deb;sudo dpkg -i libapt-pkg6.0_2.0.2ubuntu0.1_amd64.deb
from a terminal and see if that gets you going.You mentioned the aptitude tag. Please post the output of
aptitude search ~b
if above command sequence does not get you unstuck.The above command worked for me on Ubuntu 20.04, but I was still getting errors like this:
I managed to overcome it by re installing
ubuntu-advantage-tools