How to prevent updating of a specific package?

Hold a package to prevent it from being upgraded unless you specifically upgrade it. I use this to hold postgresql packages, as installing upgrades results in a restart of the database server and a micro-outage that I want to better manage.

apt-mark hold postgresql-9.5

Then the postgresql and postgresql-contrib (and sometimes client) packages appear as “held back” when you run apt-get upgrade.

You can force them to upgrade when you’re ready by explicitly installing: apt-get install postgresql-9.5

This was posted 4 years ago. It has 0 notes.