4

I recently ran a command to install a package on Ubuntu 16.04 with apt-get

% sudo apt-get install <package>

apt-get was unable to install, it printed some status messages, with the last line being:

[ output truncated... ]
E: Unable to correct problems, you have held broken packages.

I understand that apt and dpkg has a system of marking packages, where you can denote a preference regarding a package's install status.
you can view this list with

dpkg -l

So all packages in the resulting list whose status is "desired" or "install me" could be used to recreate the install state of applications on another system.
Does held broken packages have something to do with this? i.e. my packages install preferences as shown by dpkg -l express a state of packages such that if apt-get were to install them - the end result would have dependency conflicts?
What does it mean to have held broken packages?

2 Answers 2

4

That message indicates that apt didn't changed anything and the broken packages it tried to solve were kept in the same state. In this case "held" is used as "keep". If I had to reword it it would say:

Unable to correct the problems, packages are left unchanged.

2

The other answer is incomplete, and not entirely correct.

dpkg has a "hold" state. Essentially, this state means you do not want the system to upgrade the package in the given state, even if there is a newer version. This state can only be set manually. To figure out whether you have any packages in this state, run dpkg -l|grep ^h. If that produces any output, it will be the packages that are in the hold state. When there are packages in that state, and apt needs to upgrade them, you get the error message you see.

Unfortunately, you may also see the error message if apt sees a package, wants to install it, but is unable to do so due to e.g., apt pinning or other reasons. This situation can be resolved by (temporarily?) giving apt the permission to install the given files; e.g., by explicitly listing packages and versions to be installed, by passing the -t target-distribution parameter to apt, or by changing your pinning configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .