0

I have Ubuntu 20.04.2. I can't seem to install packages that require dependencies.

There are many packages I have to install with puppet, this is what of them:

~# apt install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies: aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed Recommends: libparse-debianchangelog-perl but it is not going to be installed E: Unable to correct problems, you have held broken packages.

This is what I tried:

apt update && apt upgrade  
apt autoremove
apt-get -f install
dpkg --configure -a
apt dist-upgrade
rm /etc/apt/sources.list.d/*
apt-mark showhold #shows nothing
apt install aptitude --fix-missing

Nothing works. I keep getting the error in the first code snippet. All the commands I ran above seem to have worked for other people online.

Does anyone happen to know how to fix it? Huge thanks ahead!

EDIT: I think it's related to the fact that my sources.list point to a local clone of an ubuntu 18 repo. So I deleted everything and added just the offical one, but I still get an error:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/Packages  Cannot initiate the connection to archive.ubuntu.com:80 (91.189.88.152). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (91.189.88.142). - connect (101: Network is unreachable)
E: Some index files failed to download. They have been ignored, or old ones used instead.

But I guess that's a separate issue though.

  • 1
    Correct, nothing works. That's why the system says "Impossible Situation". You have told your system to install one or more packages that are incompatible with your Ubuntu system. Maybe they are the wrong version. Maybe they are broken some other way. Random shell incantations won't help; you must understand the problem in order to fix it. – user535733 Apr 21 '21 at 14:34
  • Thanks for the response. Thing is, I have this is one of many puppet tries to install. I get the same error with npm. It's a popular package so I'd assume it would be compatible. To be honest, I'm not really sure how to debug this. – rogersjoshmac123 Apr 21 '21 at 14:36
  • Okay, so i think the problem is related to the fact that my local aptly repo is a clone of the ubuntu 18 repo. I'm still having trouble with that though. I'm updating the thread. – rogersjoshmac123 Apr 21 '21 at 14:50
  • http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/Packages is not a valid source. Wrong format. It should look more like deb http://archive.ubuntu.com/ubuntu/ focal universe. Also check your other sources to ensure that you are not mangling your system and that you are properly receiving security patches. – user535733 Apr 21 '21 at 15:17
  • 1

1 Answers1

0

On Ubuntu focal, aptitude is available from universe repository, the dependency libapt-pkg6.0 is available from focale-updates.

sudo add-apt-repository universe
sudo apt update
sudo apt install aptitude
GAD3R
  • 3,507
  • This might help the OP...but it also might not. Were they using stock Ubuntu sources, they would not have the 5.0/6.0 mismatch in the first place. Were it an add-the-Universe-pocket issue, the error would be 'package not found'. – user535733 Apr 21 '21 at 14:41
  • Thank you so much for the response! This has helped me get on the right track, I updated the thread. – rogersjoshmac123 Apr 21 '21 at 14:55
  • @rogersjoshmac123 Try the closest ubuntu mirorr. – GAD3R Apr 21 '21 at 15:08