apt prevent updating a specific package

apt prevent updating a specific package

- 1 min

(Note: This is not the first blog. The first blog has been hidden, I’ll upload it once I’ve finalized it.)

Ever had a need to prevent particular troublesome packages from being upgraded? (Looking at you virtualbox)


You can easily hold back particular package from being upgraded by using the apt-mark command.

$ sudo apt-mark hold virtualbox-6.1

And that’s it!

apt-mark-hold

apt-mark hold

Now, when you run sudo apt upgrade, it won’t ugrade your package(virtualbox in my case)

sudo apt upgrade

sudo apt upgrade

If you want to see all the packages that are being held back, you can run:

$ apt-mark showhold

apt-mark showhold

apt-mark showhold

To unhold the package, simply run:

$ sudo apt-mark unhold virtualbox-6.1

apt-mark unhold

apt-mark unhold

That’s all folks!

References:

Aman Goyal

Aman Goyal

A Man who never has enough time