pacman error messages
pacman says what went wrong in one line and then stops. The reader below matches that line against the messages written up on this site and returns the entry for it, with the steps in the order they are worth trying.
pacman -Syu
-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. Most messages here are answered by the upgrade that was skipped, which is why it is worth trying before anything is deleted.
Watch out. A message this reader has no entry for is refused rather than answered. The wording pacman printed is then the thing to search for.
Read a message
Try:
The messages it has entries for
Each row is the wording the reader matches on. A message that carries none of these is refused rather than answered.
| Entry | What it is | Wording it looks for | Page |
|---|---|---|---|
lock | The database is locked | unable to lock databasefailed to init transactiondb.lck | Database lock |
target | The package name was not found | target not found | Error messages |
signature | A package signature was refused | signature fromunknown trustinvalid or corrupted package | Keyring and signatures |
conflict-file | A file on disk is in the way | conflicting filesexists in filesystemfailed to commit transaction | Error messages |
deps | A dependency could not be satisfied | could not satisfy dependenciesfailed to prepare transactionbreaks dependency | Partial upgrades |
mirror | A file could not be fetched from a mirror | failed retrieving filethe requested url returned errorconnection timed out | Mirrorlist |
root | The command needs root | you cannot perform this operation unless you are rootoperation not permittedpermission denied | Error messages |
pacnew | A configuration file was installed alongside yours | installed as.pacnew.pacsave | .pacnew and .pacsave |
newer | The installed version is newer than the repository | is newer thandowngrading | Going back a version |
conflict-pkg | Two packages cannot both be installed | unresolvable package conflictsare in conflictconflicts with | Error messages |
uptodate | Nothing to do for that package | is up to date -- skippingthere is nothing to dois up to date -- reinstalling | Reinstalling |
How to give it a useful line
- Paste the line beginning
error:orwarning:, not the whole screen. Surrounding output does no harm, but the line that names the failure is the one that matches. - Capitalisation does not matter.
- Package names and paths in the message are ignored, so the line can be pasted as it stands without editing anything out of it.
The entries in full
The same entries, written out, for reading without JavaScript and for linking to directly.
The database is locked
pacman found /var/lib/pacman/db.lck, the file it creates while a transaction is running, so it refused to start a second one.
Either another pacman is running right now, or one was interrupted and left the lock file behind.
- Look for a pacman that is still running. If one is, wait for it.not pacman
pgrep -a pacman - If nothing is running, the lock file is stale and can be deleted.not pacman
sudo rm /var/lib/pacman/db.lck - Then run the command that was refused again.routine
sudo pacman -Syu
The package name was not found
The name given is not in any repository pacman holds a database for.
The name is spelled differently, the repository holding it is not enabled in pacman.conf, the databases have not been refreshed yet, or the package lives in the AUR and not in a repository at all.
- Search the repositories for the part of the name you are sure of.routine
pacman -Ss firefox - Refresh the databases and upgrade, then try the install again.routine
sudo pacman -Syu - If the search finds nothing, the package may be in the AUR, which pacman does not install from.
A package signature was refused
pacman checked the signature on a downloaded package against the keys in /etc/pacman.d/gnupg and did not get an answer it accepts.
The local keyring is out of date or has not been filled in, the system clock is wrong so a key looks expired or not yet valid, or the download itself is damaged.
- Check the clock first: a date in the past or the future makes valid keys look invalid.not pacman
timedatectl - Upgrade the keyring package, which is where the current keys come from. On its own that is the shape of a partial upgrade, so the full upgrade below has to follow it.risky
sudo pacman -Sy archlinux-keyring - If that is refused too, fill the keyring from the package already on disk.not pacman
sudo pacman-key --populate archlinux - Then refresh and upgrade in one command.routine
sudo pacman -Syu
More on this: Keyring and signatures
A file on disk is in the way
A package wants to write a path that is already there and that the local database does not record as belonging to that package.
The file was put there by something other than pacman, or an earlier transaction was interrupted part way through.
- Ask which package owns the path pacman named.routine
pacman -Qo /usr/bin/ls - If no package owns it, the file arrived outside pacman; move it aside and run the install again.
- If a package does own it, that is a packaging conflict, and overwriting leaves the database describing a file that is no longer the one on disk.
A dependency could not be satisfied
The transaction as asked for would leave a package needing a version of something that would not be installed.
Most often the databases are newer than the installed packages, which is what a bare -Sy leaves behind, or a name is being held back.
- Refresh and upgrade together, so the databases and the packages move at the same time.routine
sudo pacman -Syu - If a name is held back in pacman.conf, that is the version the rest of the system is being asked to live with.
- Read the dependency line pacman printed: it names the package that breaks and the version it wants.
More on this: Partial upgrades
A file could not be fetched from a mirror
pacman reached a mirror and did not get the file it asked for.
The mirror is out of date or being synchronised, it is unreachable, or the mirrorlist has no enabled server for that repository.
- Open the mirrorlist and check that at least one Server line is not commented out.
- Force a full re-download of the databases, which also gets past a database that was cached while broken.routine
sudo pacman -Syyu - If one mirror keeps failing, move another one above it in the list.
The command needs root
The command writes to the databases, the cache or the files a package owns, and the account running it may not write there.
The sudo prefix was left off a command that writes.
- Run the same command through sudo.routine
sudo pacman -Syu - Reading commands do not need it: the -Q queries, -Ss and -Si.routine
pacman -Qs firefox
A configuration file was installed alongside yours
The upgrade carried a new version of a configuration file you had edited, so pacman kept yours and wrote the new one next to it.
This is a notice, not a failure. Nothing was overwritten and nothing was lost; two files now sit side by side.
- Find the files waiting to be merged.not pacman
find /etc -name "*.pacnew" - Compare the new file with yours and carry across the parts you want.not pacman
diff /etc/pacman.conf /etc/pacman.conf.pacnew - Delete the .pacnew once it has been merged, so the next one is easy to spot.
More on this: .pacnew and .pacsave
The installed version is newer than the repository
The version on the machine is ahead of the version the repository offers, so an upgrade would move it backwards.
A mirror is behind, the package came from somewhere other than the repository, or a doubled -u asked for the downgrade.
- Refresh the databases fully before deciding, in case the mirror was stale.routine
sudo pacman -Syyu - If the repository really is behind, waiting is the quiet option.
More on this: Going back a version
Two packages cannot both be installed
Two packages declare that they cannot be installed together, usually because they provide the same thing.
A package has been replaced by another one, or two providers of the same component are both being asked for.
- Read which two names pacman printed: one of them has to go.
- Ask what is installed that matches the older name.routine
pacman -Qs firefox - Remove the one being replaced, then install the new one.caution
sudo pacman -Rns firefox
Nothing to do for that package
The version asked for is the version already installed, so pacman has no work to do.
This is a notice, not a failure.
- To put the same version back on disk anyway, ask for the install again without --needed.routine
sudo pacman -S firefox - To check the files of that package against the database instead, query them.routine
pacman -Qk firefox
Two things worth trying before anything else
A large share of what pacman refuses to do comes from one of two states: the databases and the packages have come apart, or the keys cannot check what was downloaded. Both have their own page, and both start with the same command.
sudo pacman -SyuIf it refuses to start because a lock is in the way, that is the database lock page. If it starts and then refuses the packages it downloaded, that is the keyring page.
Common questions
What does error: target not found mean in pacman?
The name given is not in any repository pacman holds a database for. The spelling may differ, the repository may not be enabled, the databases may not have been refreshed, or the package may be in the AUR rather than in a repository.
What does failed to commit transaction (conflicting files) mean?
A package wants to write a path that is already there and that the local database does not record as belonging to it. Asking pacman -Qo which package owns that path is the first step, because often nothing does.
Why does pacman say it cannot lock the database?
It found /var/lib/pacman/db.lck, the file it creates while a transaction runs. Either another pacman is running, or one was interrupted and left the file behind.
What should I do with a pacman error this page has no entry for?
Search for the wording pacman printed rather than for a paraphrase of it. The reader here refuses a message it has no entry for instead of returning the nearest one, because a wrong answer about a broken system costs more than none.