Let's say we have a package mypackage that is available in different versions from different sources. I do not want to disable any of these sources though.

However, the currently latest version of mypackage is buggy on my system, but previous versions ran fine and probably future versions will be fixed again as well.

How can I blacklist only this buggy version of mypackage so that apt does not upgrade to it, but continues receiving upgrades from all sources and will upgrade to the following versions once they are out?

Holding the package back (apt-mark hold mypackage would also prevent future updates until I manually unhold the package, which s not what I want.

  • Knowing my luck the next version would have the same glitch. – WinEunuuchs2Unix Oct 11 '16 at 17:25

You can put this in /etc/apt/preferences to assign priority < 100 to this particular version of the package:

Package: mypackage
Pin: version 1.2-3ubuntu4
Pin-Priority: 99

This will prevent the upgrade to this version, because the currently installed version is assigned priority 100 (and the package with the highest priority gets installed).

For more information, see man apt_preferences or this answer.

| improve this answer | |
  • That seems exactly like what I was looking for. I hope I'll be able to test your solution tomorrow. Thanks. – Byte Commander Oct 11 '16 at 22:24
  • Thanks, that worked as intended. Sorry that I didn't have time to verify your answer earlier :) – Byte Commander Oct 15 '16 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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