User Tools

Site Tools


ubuntu:aptitude:hold_a_package

Ubuntu - aptitude - Hold a package

Blacklist package updates.

NOTE: This method works with both installed and uninstalled packages.


Hold a package

sudo aptitude hold [package name]
sudo aptitude hold nginx

Remove the hold for a package

sudo aptitude unhold [package name]
sudo aptitude unhold nginx

Forbid a package from being upgraded to a particular version, while allowing automatic upgrades to future versions

This is useful for example to avoid a known broken version of a package such as grub:

sudo aptitude forbid-version {pkg}={version}
sudo aptitude forbid-version bash=5.0-6ubuntu1.1

When you try to upgrade package using the aptitude command you will see message:

sudo aptitude upgrade

The following packages will be upgraded:

  libcomerr2 libx11-data 
2 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
....
ubuntu/aptitude/hold_a_package.txt · Last modified: 2023/06/18 17:07 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki