/etc/pacman.conf and what is in it
Most of what the commands elsewhere on this site do is decided in one file. /etc/pacman.conf holds the general options in an [options] section and then one section per repository, in the order pacman should consult them.
pacman-conf
What it does. Print the configuration pacman is actually using, with the includes resolved, rather than reading the file and guessing.
Watch out. An option written under the wrong section heading is read as belonging to that section, which is how a repository option ends up doing nothing.
The shape of the file
[options] then one line per option; then [<repository>] with its own linesThe shape, not a working file. Order matters for the repository sections: the first one that carries a package is the one it comes from.
The repository sections are the reason two machines can be handed the same package name and get different files. The mirrorlist page covers the file those sections usually include.
Options people change
| Option | What it does | Worth knowing |
|---|---|---|
IgnorePkg | Keeps named packages out of upgrades | Covered on the holding a package back page; it is a partial upgrade you chose |
CacheDir | Where downloaded package files are kept | Moving it moves what the cache commands act on |
ParallelDownloads | How many package files are fetched at once | A number, not a switch; it changes the download and nothing about what is installed |
Color | Colours pacman's own output | A switch with no value after it, which is the shape several options here use |
VerbosePkgLists | Prints the transaction as a table with sizes | Makes the list before the confirmation easier to read, which is the list worth reading |
SigLevel | How strictly signatures are checked | The one on the keyring page; loosening it to silence an error removes the check that was working |
HoldPkg | Packages pacman warns extra loudly about removing | A warning, not a block: the removal still happens if you answer yes |
NoExtract | Paths a package is not allowed to write | Rarely needed, and it makes the database describe files that are not on disk |
Reading the configuration that is in force
The file can include others, so what is on screen is not necessarily what pacman uses. A separate program prints the resolved result:
pacman-confpacman-conf --repo-listThe repositories in the order pacman consults them, which is the order that decides where a package comes from.
This is not a pacman operation, which is why no level is given for it. It ships with pacman itself rather than with the contrib package.
When this file changes under you
An upgrade to pacman itself can carry a new pacman.conf. Because
almost everyone has edited theirs, the new one arrives as a
.pacnew:
warning: /etc/pacman.conf installed as /etc/pacman.conf.pacnewThat line is the one people most often skip, and pacman.conf is the file where skipping it costs most: a new option with a default that differs from the old behaviour changes what later commands do. The .pacnew page covers merging it.
Editing this file changes what pacman does on the next run and gives no feedback until then. Printing the resolved configuration after an edit is the cheapest way to find a line that landed under the wrong section heading.
Common questions
Where is the pacman configuration file?
At /etc/pacman.conf. It holds an [options] section for general settings and then one section per repository, in the order pacman consults them.
How do I enable a repository in pacman?
Uncomment or add its section in /etc/pacman.conf, then refresh the databases with an upgrade so that pacman has something to read for it. Order matters: the first repository carrying a package is the one it comes from.
What does pacman-conf do?
It prints the configuration pacman is actually using, with any included files resolved. That is different from reading pacman.conf by eye, which does not show what the includes brought in.
Why did my pacman.conf change get ignored?
The most common reason is that the line landed under a repository section instead of under [options], where it is read as belonging to that repository. Printing the resolved configuration shows where it ended up.