Skip to the content
pacman-master.com

Partial upgrades: what a bare -Sy leaves behind

A partial upgrade is not a command you can run. It is a state: the package databases on the machine describe one set of versions and the packages on disk are at another, so anything installed next is fitted to a system that is not there.

sudo 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. Refresh the databases and upgrade the packages in the same transaction, which is what keeps the two descriptions of the system in step.

Watch out. A machine already in a partial state is repaired by the same command, as long as the mirror it reads carries the versions the databases name.

How the two descriptions come apart

pacman keeps two separate records. The synchronised databases under /var/lib/pacman/sync describe what the repositories currently carry. The local database under /var/lib/pacman/local records what is actually installed. -Sy refreshes the first. -Su moves the second up to it. They are different jobs, and -Syu is the spelling that does both.

Why installing after a bare -Sy breaks a packageThree timelines running left to right. The top one is the repository, where libfoo moves from 1.0 to 2.0 and a package called newapp is built against 2.0. The middle one is a machine that ran a bare -Sy: its database has moved to 2.0 while libfoo on disk is still 1.0, so the newapp that lands starts against a library it was not built for. The bottom one is the same machine after -Syu, where libfoo and newapp move together and fit.The repositorylibfoo 1.0libfoo 2.0newapp needs 2.0This machine, after a bare -Sylibfoo 1.0libfoo 1.0newapp 2.0 landsthe database now says 2.0 while the disk still holds 1.0so newapp starts againsta library it was not built forThe same machine, after -Syulibfoo 1.0libfoo 2.0newapp 2.0 fitssudo pacman -Sy firefoxriskysudo pacman -Syuroutine
The break is not the new package. It is the gap between what the database says and what is on disk.

Four ways to end up in one

What was runWhy it leaves a gapLevel
sudo pacman -Sy <package>The databases move forward, the packages do not, and the package that arrives is the new onerisky
sudo pacman -Syu --ignore <package>Everything else moves and the named package stays behind, linked against libraries that have just been replacedcaution
sudo pacman -S <package> long after the last upgradeThe databases were refreshed by something else at some point, so an install pulls in dependencies newer than the rest of the machineroutine
An interrupted upgradePart of the transaction was written and the rest was not, so the two records disagree about the packages that did not finishroutine

The third row is the one that catches people who install a package after weeks without an upgrade. The install itself is ordinary; what makes it a partial upgrade is that its dependencies are resolved against a database describing a system nobody has moved to yet.

What it looks like when it bites

The usual shape is a program that stops starting and names a library file it cannot find, or names a version of one. Another shape is pacman itself refusing to prepare a transaction because a dependency cannot be satisfied. Both are the same thing said twice: something on disk was built against a version that is not on disk.

error: failed to prepare transaction (could not satisfy dependencies)

The shape of the message, not a transcript. The line after it names the package that breaks and the version it wants.

Getting out of one

The repair is the upgrade that was skipped. Run it in full:

routinesudo pacman -Syu

If a mirror is behind and does not yet carry the versions the databases name, force the databases to be fetched again so that both come from the same place:

routinesudo pacman -Syyu

The doubled y downloads the databases again even when pacman considers them current, which is what gets past a database cached from a stale mirror.

A machine that cannot reach a mirror is a different problem; the mirrorlist page covers that. A machine where the signature check refuses the downloaded packages is covered on the keyring page, and that one has a twist: the usual advice for it starts with a command this reference marks as risky.

Staying out of one

  • Type -Syu, not -Sy. The habit is the whole defence.
  • Take the upgrade before the install, not after: sudo pacman -Syu <package> puts both in one transaction.
  • Treat holding a package back as a partial upgrade you chose, and keep the list short and temporary.
  • If an upgrade is interrupted, finish it before installing anything else.

Common questions

What is a partial upgrade on Arch Linux?

It is a machine whose package databases describe newer versions than the packages installed on disk. Anything installed in that state is resolved against versions the machine does not have, so it can start against a library that is not there.

Is pacman -Sy dangerous on its own?

It rewrites the package databases and nothing else, so on its own nothing breaks. The damage comes from the next install, which is fitted to the versions those refreshed databases describe rather than to the ones on disk.

How do I fix a partial upgrade?

Run sudo pacman -Syu, which is the upgrade that was skipped. If a mirror is behind and does not carry the versions the databases name, run sudo pacman -Syyu so that the databases are fetched again rather than reused.

Can I install one package without upgrading the system?

Not without leaving the machine in a partial state. Writing sudo pacman -Syu followed by the package name puts the upgrade and the install in one transaction, which is the supported way to get that one package.

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 .