Score:1

stuck in dependencies loop - ubuntu 22.04

gi flag

im somehow ended up in package dependencies loop. when im trying to upgrade my packages following appears:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libapt-pkg6.0 : Depends: libgcrypt20 (>= 1.10.0) but 1.9.4-3ubuntu3 is installed
                 Depends: libzstd1 (>= 1.5.2) but 1.4.8+dfsg-3build1 is installed
                 Recommends: apt (>= 2.5.3) but 2.4.8 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

so i tried sudo apt --fix-broken install

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libapt-pkg6.0 : Depends: libgcrypt20 (>= 1.10.0) but 1.9.4-3ubuntu3 is installed
                 Depends: libzstd1 (>= 1.5.2) but 1.4.8+dfsg-3build1 is installed
                 Recommends: apt (>= 2.5.3) but 2.4.8 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

then i tried to remove/purge the package sudo apt purge libapt-pkg6.0:amd64

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 apt : Depends: libapt-pkg6.0 (>= 2.4.8) but it is not going to be installed
 apt-utils : Depends: libapt-pkg6.0 (>= 2.4.8) but it is not going to be installed
 packagekit : Depends: libapt-pkg6.0 (>= 1.9.2) but it is not going to be installed
 python3-apt : Depends: libapt-pkg6.0 (>= 1.9.11~) but it is not going to be installed
 ubuntu-advantage-tools : Depends: libapt-pkg6.0 (>= 0.8.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

output of apt policy libapt-pkg6.0

libapt-pkg6.0:
  Installed: 2.5.3
  Candidate: 2.5.3
  Version table:
 *** 2.5.3 100
        100 /var/lib/dpkg/status
     2.4.8 500
        500 http://ch.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     2.4.5 500
        500 http://ch.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

i tried other ways as well, but it seems that im stuck in this position. Any advice would be helpful.

tkan avatar
gi flag
@user535733 - done
tkan avatar
gi flag
thank you @user535733 when im trying to upgrade from 22.04 LTS to 22.10 with `sudo do-release-upgrade` i get this message: `Checking for a new Ubuntu release Please install all available updates for your release before upgrading. `
Score:0
cn flag

Looks like you installed 22.10 (kinetic) packages onto a 22.04 (jammy) system at some point.

libapt-pkg6.0 in 22.10 = version 2.5.3.

Lesson: Never mix packages from different releases of Ubuntu unless you are expert.

You have three options:

  1. If you don't know how that happened, and/or do not want to spend a few hours learning how to fix it, then time to reinstall 22.04 (or 22.10).

  2. Alternately, another solution is to resume using 22.10. This is more complex, because you cannot use do-release-upgrade anymore, since your packages have unmet dependencies. Whether or not this is possible depends upon how much damage you have caused, how you caused it, and whether or not you have the skills to repair it. It requires manually fixing your sources, and then using dist-upgrade. It's not a supported upgrade path, so if you encounter problems with it, our advice will be to reinstall.

  3. The most complex and highest-skill solution is to uninstall all the 22.10 packages and reinstall from the 20.04 repositories. This solution has a learning curve and requires some skill with apt. It is almost certainly faster and simpler to reinstall.

tkan avatar
gi flag
spending a few hours and learning something sounds good. do you have any starting point or reading material?
Score:0
gi flag

ok, i think i found a solution:

first i used:

sudo dpkg -r --force-depends libapt-pkg6.0:amd64

to remove the package despite dependencies

then i downloaded the correct version:

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg6.0_2.4.5_amd64.deb

then installed it:

sudo dpkg -i libapt-pkg6.0_2.4.5_amd64.deb

reboot the system and after that the update and upgrade was working again

tkan avatar
gi flag
@user535733 what do you think about that solution? legit? or was i just lucky?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.