I know how to install a specific version of a package. Now I want to upgrade all packages of my system with:
sudo apt upgrade
But for a specific package, I do not want it to upgrade to the latest version, but to a specific one. E. g., currently installed version is 1. Latest available via apt
is 3. I want to upgrade to 2. Is it possible with apt
?
With nobody's helpful comment, pointing to apt-pinning, I was able to come up with the following solution:
You can pin a package to a specific version by creating a preference file for it (e. g.
/etc/apt/preferences.d/my-package
) with the following content:This will tell
apt
to not upgrade packagemy-package
to a greater version than2
.