Friday, February 26, 2016

How to prevent updating of a specific package on Debian

If you want to make a dist-upgrade and avoid to upgrade a specific package, here you have some options:

Using dpkg

Displaying the status of your packages

dpkg --get-selections

Displaying the status of a single package

dpkg --get-selections | grep "package"

Put a package on hold

echo "package hold" | sudo dpkg --set-selections

Remove the hold

echo "package install" | sudo dpkg --set-selections


Using apt


Hold a package using:

apt-mark hold package_name

Remove the hold with:

apt-mark unhold package_name