Question
How do I prevent a package from being updated on an Ubuntu server by placing a version lock (hold) on it?
Answer
- Log into the server via SSH as the
rootuser. Print the list of packages that are currently on hold:
# apt-mark showhold
If the package you want to lock is not listed, place a hold on it.
Note: Replace $PACKAGE with the name of the package you want to hold. To hold several packages, list their names separated by spaces.
# apt-mark hold $PACKAGE
Confirm that the hold was placed. The package should now appear in the output:
# apt-mark showhold
To allow updates for the package again, remove the hold.
Note: Replace $PACKAGE with the name of the package whose hold you want to remove.
# apt-mark unhold $PACKAGE
Comments
0 comments
Article is closed for comments.