Sometimes you may need to prevent a package from upgrading on your Debian or Ubuntu server. You can accomplish this by creating a file in the /etc/apt/preferences.d/ folder called “no-upgrade”. The name of the file does not matter.

nano /etc/apt/preferences.d/no-upgrade

In this example, the package init is what we want to prevent from upgrading. If you are using Ubuntu, use this line instead, “Pin: release o=Ubuntu”

Package: init
Pin: release o=Debian
Pin-Priority: -1

Pin It on Pinterest

Share This