Hi, how do I tell the apt command to update all packages except one package? For example, say I do not wish to update a package named nginx. How can I tell apt to apply updates to all except the nginx package? Is it possible?
- Use the apt-mark hold command to hold back package from upgrades:
sudo apt-mark hold pkg1 pkg2
- Then apply updates:
sudo apt update && sudo apt upgrade
- You can remove hold i.e. remove held packages:
sudo apt unhold pkg1 pkg2
- In your case here is how to tell apt to update all packages except nginx package:
sudo apt-mark hold nginx && sudo apt upgrade
- See our tutorial " apt-get hold back packages on Ubuntu / Debian Linux " for more info.