Frequently Asked Question
How do I stop a package from being upgraded?
Sometimes you need a specific version of a package to stay put, perhaps a kernel that
a proprietary driver was built against, or a database whose upgrade you want to schedule
for the weekend. On Debian and Ubuntu, sudo apt-mark hold <pkg> pins the package: it
will be skipped by apt upgrade and listed as "kept back". sudo apt-mark unhold <pkg>
releases it, and apt-mark showhold lists everything currently pinned. Underneath, this
sets a flag in the dpkg selections database, equivalent to
echo "<pkg> hold" | sudo dpkg --set-selections.
On Fedora and RHEL, dnf does not have a built-in hold but adds an --exclude=<pkg>
flag and the versionlock plugin (dnf install python3-dnf-plugin-versionlock), which
lets you dnf versionlock add <pkg> to pin a specific version. On Arch you write the
package's name into the IgnorePkg line of /etc/pacman.conf. In every case the
effect is local to that machine, the repository still moves on without you.