Score:0

Unable to correct problems, you have held broken packages for installing aptitude

hm flag

I have tried the following for this error:

sudo apt-get update --fix-missing
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt upgrade

But I get the same error. I have actually purged mysql and mariadb and have been trying to reinstall them. I need to install mariadb-server and I am getting this error (title). Then, I saw a post that says to use aptitude. And when I try to install aptitude or mariadb-server I get this error.

This is my /etc/apt/sources.list file after modifying it:

deb http://archive.ubuntu.com/ubuntu focal universe

Error trace

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: libboost-iostreams1.71.0 but it is not installable
            Depends: libcwidget4 (>= 0.5.18-1) but it is not going to be installed
            Depends: libsigc++-2.0-0v5 (>= 2.8.0) but it is not installable
            Recommends: libparse-debianchangelog-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I am using Ubuntu 20.04

This is the apt policy aptitude:

aptitude:
  Installed: (none)
  Candidate: 0.8.12-1ubuntu4
  Version table:
     0.8.12-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages

Thanks in advance!

Organic Marble avatar
us flag
An obvious problem is that you have repos from both bionic and trusty. What version of Ubuntu do you think you have? Please edit your question and include the full output of the error text. Also the output of `apt policy aptitude`
divyashie avatar
hm flag
@OrganicMarble I just made the updates. Yeah I just removed the trusty ones cuz I added them and changed to focal which was its default.
Organic Marble avatar
us flag
If that is really your complete sources list, you should follow the instructions here https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories to fix that into a proper focal sources list. If that is really your complete sources list, you have only the universe repo!
Artur Meinild avatar
vn flag
Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages)
Score:0
us flag

I'm quite confused by what your sources list really looks like. Your initial post listed repos from bionic and trusty. Now you say your system is focal and show a sources list that contains only the focal universe repo.

However, this may actually be the case. For example, apt is complaining about not being able to install libboost-iostreams1.71.0 which is in the main repo. So perhaps you truly don't have that repo in your sources list, and that would explain why you can't install aptitude.

If that is the true state of your sources list, you can either refer to the instructions in the answers to How do I restore the default repositories? or use this default focal sources list.

deb http://us.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse

Then update your system. If your sources list was really what you showed earlier, you may experience major problems at this step. If you can get through the upgrade, you should then be able to install aptitude.

divyashie avatar
hm flag
thank you so much, this really helped. I was able to restore the default repositories and successfully get mariadb installed.
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.