Holding a package at its installed version
There are two ways to keep a package out of an upgrade: a flag on the command for one run, and a line in pacman.conf that lasts until it is taken out again. They have the same effect on the machine and very different effects on the person.
sudo pacman -Syu --ignore linux
-S- --sync — install packages from the repositories and upgrade the system
-y- --refresh — refresh the package databases from the mirrors
-u- --sysupgrade — upgrade every installed package that is out of date
Needs root.
What it does. Upgrade the system while leaving the named package at the version it is at.
Watch out. Holding one package while everything around it moves is a partial upgrade narrowed to one name, and it gets worse the longer the hold lasts.
The two ways
| Where it lives | How long it lasts | How it is undone |
|---|---|---|
--ignore on the command line | One command | By not writing it next time |
IgnorePkg in /etc/pacman.conf | Until the line is removed | By editing the file, which is a thing to remember |
IgnoreGroup in /etc/pacman.conf | Until the line is removed | The same, applied to a whole package group |
sudo pacman -Syu --ignore linuxSeveral names can be given at once, separated by commas.
IgnorePkg = linux linux-headersA line in the [options] section of /etc/pacman.conf. Names are separated by spaces here rather than by commas.
pacman prints a line for each held package during the upgrade, so the hold is visible every time it applies. That line is the thing most people stop reading after a week, which is the argument for the flag over the configuration file.
What it costs
A held package keeps running against the libraries that were on the machine when it was installed, and the upgrade has just replaced those. The failure is not immediate and it is not always loud: a program that starts fine can fail on the one code path that reaches the library that moved.
That is the same shape as the breakage described on the partial upgrade page, narrowed from the whole system to one name. It is why holding a kernel back for a day while a driver is sorted out is ordinary practice and holding a library back for a month is not.
The cases where something else is the answer
| What you actually want | The better move |
|---|---|
| The new version has a bug and the old one worked | Go back to the old one from the cache, described on the downgrade page, and follow the bug rather than freezing |
| An upgrade is inconvenient right now | Do not upgrade now. Running no upgrade is safer than running a partial one |
| The kernel keeps moving and a module has to be rebuilt each time | That is a packaging question about the module, not a reason to hold the kernel |
| You want a package never to change again | That is a machine that stops receiving fixes, which is a decision to take with open eyes rather than through a configuration line |
Seeing what is held right now
The lines are plain text, so reading them back is a shell job:
grep -i '^Ignore' /etc/pacman.confHolding by group is the same idea applied wider, and the pacman.conf page covers the rest of what lives in that file. A held package also changes what an upgrade reports, so a machine that looks up to date may be up to date apart from the names on that line.
pacman -QuLists the installed packages a refreshed database says are out of date, which is the list a hold is quietly subtracting from.
Common questions
How do I stop pacman from upgrading one package?
Add --ignore and the package name to the upgrade command for a single run, or put an IgnorePkg line in the [options] section of /etc/pacman.conf to make the hold last until that line is removed.
Is IgnorePkg safe to use?
It leaves the held package linked against libraries the upgrade has just replaced, which is a partial upgrade narrowed to one name. As a short deliberate hold it is workable; as a standing line it accumulates risk.
What is the difference between --ignore and IgnorePkg?
They do the same thing to the transaction. --ignore applies to the one command you type it on, while IgnorePkg sits in pacman.conf and applies to each upgrade until somebody edits the file.
How do I see which packages are being held back?
Read the Ignore lines out of /etc/pacman.conf, and watch the upgrade output: pacman prints a line naming each package it is skipping because of them.