Introduction to Package Pinning
I’ve found package pinning to be a lifesaver on Debian-based systems, allowing you to specify the exact version of a package to install or keep. This is particularly useful when managing dependencies and avoiding potential conflicts or compatibility issues. I’ve seen this go wrong when a package update breaks a critical application, so it’s essential to have control over package versions.
Understanding Package Pinning
To pin a package, you’ll need to create a file in the /etc/apt/preferences.d/ directory with a .pref extension. This file should contain the package name and the desired version. For example, to pin the nginx package to version 1.23.4, you would create a file called nginx.pref with the following contents: