How to hold back packages from being updated in Ubuntu

Overview

If you want to hold back a package from being upgrade in ubuntu you can use the apt-mark command.

Hold back a package

This will prevent the package from being updated when you upgrade.

1
sudo apt-mark hold <package name>

UnHold a package

This will unhold the package and make it upgrade automatically when you upgrade.

1
sudo apt-mark unhold <package name>

Show which packages are held back

If you’re like me and you forget which packages you held back you can show a list of all held packages.

1
apt-mark showhold