October 16, 2008

Debian: Mark packages on hold

If you have installed some Debian/Ubuntu package, that you don’t wanna update trough apt-get upgrades, you can put a flag HOLD to that package.

The HOLD flag will prohibit accessing that package by regular apt-get upgrade_s. To put a package on HOLD, use the following command:

echo {PACKAGENAME} hold | dpkg --set-selections

root@recorder:~# echo vlc hold | dpkg --set-selections
root@recorder:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  vlc vlc-nox
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


  1. Yeah, very nice feature, but it seems to me, that aptitude can do that and much, much more with using single binary. It also seems like it has way better dependency handling thant apt-get.

    Once I switched to aptitude I never bothered to look back.

    Have fun

  2. @Anonymous: Yeah, you are right. aptitude becomes more and more popular lately. Tho, I am still more used to apt-get and so far I have had only few times issues with dependencies.