0
  • $ sudo apt-get update -y && sudo apt-get full-upgrade && sudo apt autoremove -y
Get:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Hit:2 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Fetched 270 kB in 11s (23.9 kB/s)
Reading package lists... Done
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:
 libcairo-gobject-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-perl : Depends: perlapi-5.30.0 but it is not installable
 libcommon-sense-perl : Depends: perlapi-5.30.0 but it is not installable
                        Depends: perl (< 5.30.1~) but 5.34.0-3ubuntu1 is installed
 libfile-fcntllock-perl : Depends: perlapi-5.30.0 but it is not installable
 libgcc-s1:i386 : Depends: libc6:i386 (>= 2.35) but it is not installed
 libgcrypt20:i386 : Depends: libc6:i386 (>= 2.33) but it is not installed
                    Depends: libgpg-error0:i386 (>= 1.27) but it is not installed
 libgjs0g : Depends: libgirepository-1.0-1 (>= 1.66.0) but 1.64.1-1~ubuntu20.04.1 is installed
            Depends: libgirepository-1.0-1-with-libffi8 (>= 1.64)
 libglib-object-introspection-perl : Depends: perlapi-5.30.0 but it is not installable
 libpython3.10-stdlib : Depends: libmpdec3 but it is not installed
 python3 : PreDepends: python3-minimal (= 3.8.2-0ubuntu2) but 3.10.4-0ubuntu2 is installed
           Depends: libpython3-stdlib (= 3.8.2-0ubuntu2) but 3.10.4-0ubuntu2 is installed
 python3-pyqt5.sip : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-renderpm : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-reportlab-accel : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-simplejson : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-sip : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-talloc : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-yaml : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
  • $ sudo apt --fix-broken install
After this operation, 56.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 286966 files and directories currently installed.)
Preparing to unpack .../python3-distutils_3.10.4-0ubuntu1_all.deb ...
Unpacking python3-distutils (3.10.4-0ubuntu1) over (3.8.10-0ubuntu1~20.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-distutils_3.10.4-0ubuntu1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python3.10/distutils/README', which is also in package python3.10-distutils 3.10.4-1+focal2
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../python3-lib2to3_3.10.4-0ubuntu1_all.deb ...
Unpacking python3-lib2to3 (3.10.4-0ubuntu1) over (3.8.10-0ubuntu1~20.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-lib2to3_3.10.4-0ubuntu1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python3.10/lib2to3/Grammar.txt', which is also in package python3.10-lib2to3 3.10.4-1+focal2
Preparing to unpack .../libcrypt-dev_1%3a4.4.27-1_amd64.deb ...
Unpacking libcrypt-dev:amd64 (1:4.4.27-1) over (1:4.4.10-10ubuntu4) ...
Preparing to unpack .../libcrypt1_1%3a4.4.27-1_amd64.deb ...
Unpacking libcrypt1:amd64 (1:4.4.27-1) over (1:4.4.10-10ubuntu4) ...
Selecting previously unselected package libcrypt1:i386.
Preparing to unpack .../libcrypt1_1%3a4.4.27-1_i386.deb ...
Unpacking libcrypt1:i386 (1:4.4.27-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3-distutils_3.10.4-0ubuntu1_all.deb
 /var/cache/apt/archives/python3-lib2to3_3.10.4-0ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Getting unmet dependencies error while upgrading to Ubuntu 22.04 lts from Ubuntu 20.04 lts.

Why this dependency error is occurring and how to resolve this dependency error?

Edit

Running command one at a time and removed the -y parameter for upgrading

  • $ sudo apt update
Get:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Hit:2 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 270 kB in 2s (143 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1947 packages can be upgraded. Run 'apt list --upgradable' to see them.
  • devp@Painkiller:~$ sudo apt 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:
 libcairo-gobject-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-perl : Depends: perlapi-5.30.0 but it is not installable
 libcommon-sense-perl : Depends: perlapi-5.30.0 but it is not installable
                        Depends: perl (< 5.30.1~) but 5.34.0-3ubuntu1 is installed
 libcrypt1:i386 : Depends: libc6:i386 (>= 2.25) but it is not installed
 libfile-fcntllock-perl : Depends: perlapi-5.30.0 but it is not installable
 libgcc-s1:i386 : Depends: libc6:i386 (>= 2.35) but it is not installed
 libgcrypt20:i386 : Depends: libc6:i386 (>= 2.33) but it is not installed
                    Depends: libgpg-error0:i386 (>= 1.27) but it is not installed
 libgjs0g : Depends: libgirepository-1.0-1 (>= 1.66.0) but 1.64.1-1~ubuntu20.04.1 is installed
            Depends: libgirepository-1.0-1-with-libffi8 (>= 1.64)
 libglib-object-introspection-perl : Depends: perlapi-5.30.0 but it is not installable
 libpython3.10-stdlib : Depends: libmpdec3 but it is not installed
 python3 : PreDepends: python3-minimal (= 3.8.2-0ubuntu2) but 3.10.4-0ubuntu2 is installed
           Depends: libpython3-stdlib (= 3.8.2-0ubuntu2) but 3.10.4-0ubuntu2 is installed
 python3-pyqt5.sip : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-renderpm : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-reportlab-accel : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-simplejson : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-sip : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-talloc : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
 python3-yaml : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
devpa
  • 843
  • 2
    sudo apt-get update -y && sudo apt-get full-upgrade && sudo apt autoremove -y -- you're missing all of the important diagnostic information by using this command. You should run them separately without the -y flag so you can get an idea what's going on. You shouldn't release upgrade until your package management is in good shape. Also, you may need to wait a few days before release upgrade is available. 22.04 ISOs were released today but that doesn't necessarily mean that release upgrade is available. Release upgrade from 20.04 won't be pushed until 22.04.1 (probably in August) – Nmath Apr 22 '22 at 09:19
  • Edit your question with sudo apt update and sudo apt upgrade so we can see what's going on – Nmath Apr 22 '22 at 09:20
  • @Nmath I have update the question – devpa Apr 22 '22 at 09:31
  • 1
    1947 packages can be upgraded -- when is the last time your system has been up-to-date? It looks like you may have several concurrent package management problems. Are you using the version of python packaged with your system? Or have you manually changed versions of any other packages that might have caused dependency hell? – Nmath Apr 22 '22 at 09:38
  • @ Nmath I regularly update my system facing this issue today when tried to upgrade to ubuntu 22.04 using sudo apt do-release-upgrade -d – devpa Apr 22 '22 at 09:46
  • If you've always been using the command you posted in your question, I'm not sure you would be necessary alerted to such issues. It also could be that the upgrade has simply failed leaving you with a broken system. Your sources indicate jammy but your packages are probably still using the versions in focal. Unfortunately, in this situation, you may need to reinstall to clear this up since there are so many issues – Nmath Apr 22 '22 at 09:51
  • @Nmath few days ago I had some dependencies issues link with python but that has been fixed and it was working fine. Now other python dependencies errors are coming when trying to upgrade to 22.04 – devpa Apr 22 '22 at 10:01
  • At least a few of the issues are with the same python versions and libraries so I would guess that the original problem was not sufficiently resolved. Do you know what caused the original problem? Have you added a different python version to your system? – Nmath Apr 22 '22 at 10:51
  • initially I had python3.8 as default python3 in order to set it to python 3.10 used this command update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3 10 but that was problematic because after this terminals started crashing so had to reset python3 to 3.8 through tty – devpa Apr 22 '22 at 10:58
  • 2
    Changing the python version is well known to break an installation. Your best path forward at this point is probably to reinstall. In the future if you need a different python version for a task, it's best to do it in an environment. An example: https://askubuntu.com/a/865644 – Nmath Apr 22 '22 at 11:08
  • @Nmath reinstall what? – devpa Apr 22 '22 at 11:28
  • The operating system – Nmath Apr 22 '22 at 18:04
  • I could not boot had to reinstall system – devpa Apr 23 '22 at 02:52

0 Answers0