If you need to prevent a package from upgrading during ‘apt-get upgrade’, you need to put that package on hold:

$ sudo apt-mark hold package_name

When you run ‘apt-get upgrade’ with a package on hold, the output will look like this:

$ sudo apt-get upgrade
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 Calculating upgrade… Done
 The following packages have been kept back:
   virtualbox-6.0 

To list the packages on hold:

$ sudo dpkg --get-selections | grep "hold"

Once a package is on hold, you must manually release it to upgrade it:

$ sudo apt-mark unhold package_name

Leave a Reply

Your email address will not be published.