Exclude packages from apt-get upgrade

14 November 2020 Linux Shell command

To hold a package:

$ sudo apt-mark hold <package>

or

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

To unhold a package:

$ sudo apt-mark unhold <package>

or

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