apt-get says that there are 'held broken' packages when there are no held packages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
While attempting to install some package, apt-get tells me:
E: Unable to correct problems, you have held broken packages.
But looking for the held packages returns nothing.
Hence, an obvious contradiction.
This problem is important because this message obscures the real reasons behind the failure of the often used 'apt-get install' command.
The message produced is absolutely not helpful for understanding of what is actually wrong.
--- console log showing a problem ---
$ sudo apt-get install libqt4-dev
[sudo] password for xxx:
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:
libqt4-dev : Depends: libqt4-dbus (= 4:4.8.1-0ubuntu4) but 4:4.8.1-0ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.
$ dpkg --get-selections | awk '{if ($2 == "hold") print $0;}'
<... no output ...>
I had the same error, and I solved it by checking the first two items in the screenshot. You can open it by opening system settings ====> software & updates =====> updates tab. After closing the window, type 'sudo apt-get update' in the terminal.