Possible Duplicate:
How to prevent updating of a specific package?
Keep the Ubuntu package version I'm using now

Is it possible to upgrade all packages except a given package? Is there something like apt-get upgrade --exclude package_to_exclude?

  • 1
    Actually you can do this with several methods, see the link I gave you above.
    – Panther
    Jan 30, 2012 at 4:09

2 Answers 2


To hold a package:

In short: sudo apt-mark hold <package>


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

To unhold a package:

In short: sudo apt-mark unhold <package>


echo <package> install | sudo dpkg --set-selections
  • 1
    I get the following error: Usage: apt-mark [options] {markauto|unmarkauto} packages... apt-mark: error: first argument must be 'markauto', 'unmarkauto' or 'showauto' Jan 30, 2012 at 4:25
  • Strange. It works for me. Just tried it using sudo apt-mark hold unity-greeter
    – Zoke
    Jan 30, 2012 at 4:28
  • I think this error has to do with the Ubuntu version. Versions prior to 12.04 don't support apt-mark hold
    – user733211
    Jun 7, 2013 at 10:48
  • 1
    Once the package should be updated again, use the unhold parameter. Nov 5, 2014 at 5:57
  • 9
    Also, sudo apt-mark showhold will show that it is now on hold. (Note: that isn't showhole, that's a Netflix error state.)
    – flickerfly
    Oct 31, 2016 at 17:30

Check out "Introduction to Holding Packages" in the Ubuntu's Pinning Howto


Not the answer you're looking for? Browse other questions tagged .