Exclude Packages from being Installed and Upgraded in Debian/Ubuntu

Package - http://www.sxc.hu/photo/918252

Package managers make life on Linux a whole lot easier. Instead of managing bits of software by yourself and sorting out the inevitable dependency hell, where one package depends upon another and that depends upon yet another and so on, you can have a clever bit of software do all the work.

Debian, Ubuntu and other derivatives use the .deb package format and Aptitude (Apt for short) as the package manager.

However, there are some occasions when your package manager can hinder, rather than help. It may end up insisting on installing or upgrading something you don't want, or upgrading something you want left alone at its current version. Its persistence could extend to your update manager on your desktop nagging you every five minutes - wouldn't it be nice to shut it up?

To avoid this problem, Apt users can specify to put specific packages on hold, preventing them from being upgraded or installed. Of course, you can easily remove this restriction later.

To do this, first install the Wajig program, which offers a simple command line interface to Dpkg and Apt.

$ sudo apt-get install wajig

Once the program is installed, you can put a package on hold, so it will be ignored by Apt, like so:

$ sudo wajig hold package

When you now go to upgrade or install new packages, you will not be pestered to update that package.

Naturally, when you want to remove this restriction, simply run the command again with 'unhold':

$ sudo wajig unhold package

Also, if at any time you want to see the list of packages that are on hold, run:

$ sudo wajig list-hold

A simple solution to what can be a rather irritating problem.

[image source]

Avatar for peter Peter Upfold - http://peter.upfold.org.uk/

Peter Upfold is a technology enthusiast from the UK. Peter’s interest in Linux stems back to 2003, when curiosity got the better of him and he began using SUSE 9.0. Now he runs Linux Mint 9 on the desktop, runs a CentOS-based web server from home for his personal website and dabbles in all sorts of technology things across the Windows, Mac and open source worlds.

Home » Articles »

Discussion: Exclude Packages from being Installed and Upgraded in Debian/Ubuntu

  1. # Posted on 22 August 2008 at 10:55 PM

    [...] Put .debs on hold Filed under: Linux — 0ddn1x @ 2008-08-22 22:55:23 +0000 http://fosswire.com/2008/08/20/exclude-packages-from-being-installed-and-upgraded-in-debianubuntu/ [...]



  2. hidden (guest)

    # Posted on 10 September 2008 at 12:12 AM

    Recent Ubuntu subversion update (from 1.4.6 to 1.5.1) brought some troubles to me, so i had to roll-back to the previous version. Still, i would like to be able to perform updates without unchecking same packages in update-manager all the time. So, wajig is exactly what i was looking for to solve this problem.

    So, i just wanted to say thanks a lot for posting this tip. Keep it up!



  3. # Posted on 17 January 2009 at 08:46 PM

    [...] etch e aggiornamenti frequenti del kernel Ciao, leggi qui: http://fosswire.com/2008/08/20/exclu...-debianubuntu/ Puoi installare wajig e dare un wajig hold linux-image wajig hold linux-modules per evitare [...]



  4. German (guest)

    # Posted on 28 August 2009 at 12:07 PM

    wajig is smart and simple. It was very usefull, thanks man.



Home » Articles » Exclude Packages from being Installed and Upgraded in Debian/Ubuntu