Recently, I needed to get a list of packages that were installed on my Ubuntu system which were also put on hold for upgrade.

The 'hold' status for a package means that when the operating system is upgraded, the installer will not upgrade these packages either, unless explicitly stated in the options.

I am looking for a command-line solution but understand this may be possible from the GUI as well.


You can use apt-mark:

apt-mark showhold

this will show the packages that are kept in "hold" state so that the pacakge manager won't auto upgrade the packages.

From man apt-mark:

           showhold is used to print a list of packages on hold
  • 3
    Shows nothing but system is complaining about held packages. Must be more fundamental way. – mathtick Mar 25 '20 at 18:54
  • 1
    just upgraded to, then did a fresh install of xubuntu 20.04.1 desktop. I have the same experience --> " lib32z1 : Depends: libc6-i386 (>= 2.4) but it is not going to be installed E: Unable to correct problems, you have held broken packages." apt-mark showhold returns null – BISI Nov 5 '20 at 0:46

Use dpkg

dpkg -l | grep "^hi"

The -l means to list all packages which are then piped into grep.

The regular expression "^hi" means to search for all lines that begin with "hi" which are initials for "hold" and "installed".

By default, dpkg -l will list the status, package name, version, architecture, and a short description.

  • This method works on debian systems regardless of the higher level package wrapper being used, thus it is more general. – uDude Jul 30 '19 at 14:01
  • for inspecting my system when something fishy is going on dpkg -l | grep --invert-match "^ii" helped me every now and then. - this lists all packages which are not just installed as they should be. – DJCrashdummy Feb 20 at 5:19

as an alternative you can also use dpkg --get-selections:

dpkg --get-selections | grep "\<hold$"

dpkg --get-selections lists the status of all installed packages and grep "\<hold$" only shows lines which end with the word "hold".

perhaps also interesting, if you are looking for irregularities - especially if the above shows nothing (useful), would be

dpkg --get-selections | grep --invert-match "\<install$"

this shows all lines/packages which are not just installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.