Keep getting error message "E: Unable to correct problems, you have held broken packages."

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Mahlerian
Level 1
Level 1
Posts: 3
Joined: Sun Jul 03, 2016 11:12 am

Keep getting error message "E: Unable to correct problems, you have held broken packages."

Post by Mahlerian » Wed Aug 15, 2018 8:58 am

I am running Linux Mint 19. I am trying to install Virtualbox and the Glasgow Haskell Compiler but I keep getting the error "E: Unable to correct problems, you have held broken packages."

Code: Select all

$ sudo apt-get install virtualbox-qt
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.
 virtualbox-qt : Depends: libqt5opengl5 (>= 5.0.2) but it is not going to be installed
                 Depends: libqt5printsupport5 (>= 5.0.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Code: Select all

$ sudo apt-get install ghc
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.
 ghc : Depends: libc6-dev but it is not going to be installed
       Depends: libncurses5-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
How do I repair this? I get this message all the time and it is annoying since I don't even hold any broken packages. I have gone into Synaptic and clicked "Fix broken packages" and it says "successfully fixed dependency problems". I have tried the commands

Code: Select all

sudo dpkg --configure -a
and

Code: Select all

sudo apt-get install -f
too and that didn't resolve it.

Mute Ant
Level 13
Level 13
Posts: 4918
Joined: Tue Sep 03, 2013 7:45 pm

Re: Keep getting error message "E: Unable to correct problems, you have held broken packages."

Post by Mute Ant » Wed Aug 15, 2018 9:30 am

It's an Engrish error message that doesn't say what it means. It is better put...
"If that package was installed it would be broken, so it hasn't been installed. Make the dependencies available then try to install it again."

sudo apt-get install virtualbox-qt ### Some packages could not be installed.

Normally the repositories seen by command apt-get provide a full set of packages and dependencies, you don't see this message. You broke apt-get by adding a repository that isn't compatible with your Mint, something that has a newer virtualbox-qt but not the additional packages it needs.

Mint's Software Sources Manager has a button to reset the apt-get system to the default, compatible repositories.
Last edited by Mute Ant on Wed Aug 15, 2018 9:36 am, edited 1 time in total.
Data stored in an encrypted volume will only be accessible with the original password. Without this key, all the data will remain scrambled beyond hope of recovery.

User avatar
Pierre
Level 17
Level 17
Posts: 7280
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Keep getting error message "E: Unable to correct problems, you have held broken packages."

Post by Pierre » Wed Aug 15, 2018 9:36 am

click on Package Manager AKA synaptic - - Edit - Fix Broken Packages - - click on Apply
and then see if any extra packages are then downloaded . . .
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

Mahlerian
Level 1
Level 1
Posts: 3
Joined: Sun Jul 03, 2016 11:12 am

Re: Keep getting error message "E: Unable to correct problems, you have held broken packages."

Post by Mahlerian » Wed Aug 15, 2018 9:56 am

I managed to resolve this by using aptitude instead of apt-get. It ended up downgrading some packages for me.

I already tried fixing broken packages in Synaptic and it didn't do anything. I also restored the default settings in the Software sources manager.

I'm not sure I'd say this is solved though, since something is obviously broken and I know I'll end up getting this annoying error in the future.

Mute Ant
Level 13
Level 13
Posts: 4918
Joined: Tue Sep 03, 2013 7:45 pm

Re: Keep getting error message "E: Unable to correct problems, you have held broken packages."

Post by Mute Ant » Wed Aug 15, 2018 10:41 am

If you leave Mint to choose it's own repositories you don't get the error, so it counts as an own-goal. I imagine Debian, Ubuntu and so on have machine-checks so that every package in their repository can be installed from their repository. Flatpak is one way of avoiding OS contamination by 'foreign' packages. They are pretty much the same binaries running under the supervision of a Flatpak kernel instead of directly under Linux.
Data stored in an encrypted volume will only be accessible with the original password. Without this key, all the data will remain scrambled beyond hope of recovery.

Post Reply

Return to “Newbie Questions”