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?

marked as duplicate by Panther, Uri Herrera, jokerdino, Jjed, fossfreedom Jan 30 '12 at 7:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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' – Olivier Lalonde Jan 30 '12 at 4:25
  • Strange. It works for me. Just tried it using sudo apt-mark hold unity-greeter – Zoke Jan 30 '12 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 '13 at 10:48
  • 1
    Once the package should be updated again, use the unhold parameter. – Markus Junginger Nov 5 '14 at 5:57
  • 5
    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 '16 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 or ask your own question.