Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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