Skip to the content
pacman-master.com

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 livesHow long it lastsHow it is undone
--ignore on the command lineOne commandBy not writing it next time
IgnorePkg in /etc/pacman.confUntil the line is removedBy editing the file, which is a thing to remember
IgnoreGroup in /etc/pacman.confUntil the line is removedThe same, applied to a whole package group
cautionsudo pacman -Syu --ignore linux

Several names can be given at once, separated by commas.

IgnorePkg = linux linux-headers

A 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 wantThe better move
The new version has a bug and the old one workedGo 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 nowDo 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 timeThat is a packaging question about the module, not a reason to hold the kernel
You want a package never to change againThat 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:

not pacmangrep -i '^Ignore' /etc/pacman.conf

Holding 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.

routinepacman -Qu

Lists 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.

How to check this page

Two commands on your own machine: pacman -<operation> --help lists the modifiers that operation accepts, and man pacman opens the pacman(8) manual page these descriptions are written from. Where the descriptions come from, and what this site is not, is set out on the about page.

This page was last edited on .