Debian /etc/apt/sources.list

sma3092 used Ask the Experts™

I use the command apt-get to keep my system up to date.  The list of repositories I use to get updated
packages is kept in /etc/apt/sources.list.  I already have a particular package installed which I do not want
to update.

How do I get apt-get to ignore updating this package when it is invoked on the command line?
Is it possible to put the package name in the sources.list file etc.  This would be really useful so that if someone
else is managing the system they do not have to be aware that this package should be ignored.

Thanks in Advance
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
packages put on 'hold' are not automatically upgraded. To put a package on hold run:

echo "<package> hold" | dpkg --set-selections

See apt and dpkg quick reference for more info -->
Unless you're using a system that's so old you can't use it, i'd really urge you to switch to using aptitude.

From the aptitude screen, you'd simply need to highlight the package in question and press "=".  You'll see a lowercase "h" appear next to the entry, and from then on the package won't be updated until you alter the selection.
Also, by working that way none of the necessary package dependencies upon which the package is dependent will be altered without you first authorizing the resolution method.  I don't think apt by itself is able to work out the dependencies as cleanly as aptitude, and certainly the display and notification methods it uses are much less transparent.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial