3

I am attempting to upgrade a few packages using the apt package manager. However there is a specific package in the list that I don't want to upgrade. In fact I don't want anyone to ever upgrade it. Is there a way from forever blocking any specific packages?

In this case there's a grub update that I don't want to occur ever by myself or any other unix admins. Is this even possible? If so how do I go about doing it.

5

You need to put the package “on hold”. You do that by issuing

echo 'your-package hold' | dpkg --set-selections

Use

dpkg --get-selections [package pattern]

to see what the current selections are.

Use

echo 'your-package install' | dpkg --set-selections

to make the package upgradeable again.

  • That works perfectly. FYI if you are using apt the solution is using a tool called apt-mark and the syntax is as follows: apt-mark hold ^grub. – Mark D Apr 12 '12 at 17:24
1

Putting the package on hold at the dpkg level is one approach. Another one is to assign such a high priority to the installed package within apt that it is never upgraded. See man apt_preferences.

0

With Aptitude, interactively: press = (or select “Hold” from the “Package” menu) on the package line. On the command line:

aptitude hold grub-pc

Since Debian wheezy, you can also use apt-mark hold grub-pc (thanks Mark D).

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.