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.
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:36http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/Packages
is not a valid source. Wrong format. It should look more likedeb 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