On Archlinux it is not recommended to update only one package with the package manager pacman. Let’s say I have 11 packages, and one of them is extra/firefox (true story). Updating only a pacman -S firefox could introduce problems, but installing a new single package if it wasn’t there is okay.
So my question is, could we get around this by removing and installing the same package again in one go: pacman -Rs firefox && pacman -S firefox
I think you are a little confused at the problem here. The issue is that partial updates are not supported. The reason for this is very simple, Arch ensures that any given package list works on its own, but not that packages from different versions of the package list work together. So if Firefox depends on libssl the new Firefox package may depend on a new libssl function. If you install that version of Firefox without updating libssl it will cause problems.
There is no way around this limitation. If you install that new Firefox without he new libssl you will have problems. No matter how you try to rules lawyer it. Now 99% of the time this works. Typically packages don’t depend on new library functions right away. But sometimes they do, and that is why as a rule this is unsupported. You are welcome to try it, but if it breaks don’t complain to the devs, they never promised it would work. But this isn’t some policy where you can find a loophole. It is a technical limitation. If you manage to find a loophole people aren’t going to say “oh, that should work, let’s fix it” it will break and you will be on your own to fix it.
Focusing on your commands. The thing is that
pacman -S firefoxis always fine on its own. If Firefox is already installed it will do nothing, if it isn’t it will install the version from the current package list. Both of those operations are supported. Alsopacman -Rs firefox && pacman -S firefoxis really no different than justpacman -S firefox(other than potentially causing problems if the package can’t be allowed to be removed due to dependencies). So your command isn’t accomplishing anything even if it did somehow magically work around the rules.What is really the problem is
pacman -Sy. This command updates the package list without actually updating any packages. This will enter you system into a precarious state where any new package installed or updated (example ourpacman -S firefoxcommand form earlier) will be a version that is mismatched with the rest of your system. This is unsupported and will occasionally cause problems. Generally speaking you shouldn’t runpacman -Sy, any time you are using-Syyou should also be passing-u. This ensures that the package list and your installed packages are updated together.This is an excellent answer and I wish I knew all of this when starting to use archlinux. “Arch does not support partial upgrades” is something you can read everywhere, but it’s rare to find such a good explanation of what exactly a partial upgrade is, and which commands lead to it.
I only learned about all of this when I got into some broken state by randomly running pacman commands.
Everyone, be like this guy. This guy explains stuff well. Newbies need stuff explained.
But I’m not doing
pacman -Sy package. That is not what I am talking about. I am only talking aboutpacman -S package, which is not updating the system partially. IF the package depends on something else to update, then the system would need to be updated. But that is not what I was asking, because I only talk about the package with-S package. I just chosefirefoxas an example, it could have been any other package.To make it clear, when I say
-S firefox, then I mean really that without updating a dependency like libssl. The idea is to install only new packages without updating anything on the system. I guess as you say it depends on the dependencies of the package, if this is feasible.But that is my point. Just running
pacman -S firefoxis fine as long as you didn’t runpacman -Syat some point earlier. It won’t update anything, even dependencies. It will just install the version that matches your current package list and system including the right version of any dependencies if they aren’t already installed.But that means if you already have Firefox installed it will do nothing.
We can install a new package if it wasn’t installed with
pacman -S firefox. That is not a partial upgrade of the system. Right? What i don’t understand is, when I uninstall withpacman -Rs firefox, delete the cached firefox package (only that file), then the system is in the same state as before I installed it. Then-S firefoxshould be okay, right? And it even looks up the new version. This is my question, if that would work correctly.IF no dependency tries to update too. Off course in that case I would stop. Without
pacman -Sy, I never do that anyway, only-Syu.IF no dependency tries to update too. Off course in that case I would stop. Without pacman -Sy, I never do that anyway, only -Syu.
That’s all you need to know. As long as you always use
pacman -Syuyou will be fine.pacman -Syis the real problem. The wiki page is pretty clear about the sequences of commands that are problematic https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported.Right? What i don’t understand is, when I uninstall with pacman -Rs firefox, delete the cached firefox package (only that file), then the system is in the same state as before I installed it. Then -S firefox should be okay, right? And it even looks up the new version.
This isn’t correct. It won’t look up the new version. Assuming that the system was in a consistent state it will download the exact same package that you deleted. The system only ever “updates” when you run
pacman -Sy. Until you use-yall packages are effectively pinned at a specific version. If the version that gets installed is different than the one you removed it probably means that you were breaking the partial update rule previously.
No,
pacman -S firefoxwill not update your firefox.pacman -Sy firefoxwill update your firefox and nothing else.If you have done
pacman -Syonce, then your list of packages and their versions gets updated.
From then on, usingpacman -S <package>on any package, whether or not it was already installed, will now get the new version of it.On the other hand, if you have not updated for long, then if you run
pacman -Suto update, it will update nothing, because it looks at the old package list and compares it to installed packages and all of them match.
If you were to usepacman -Syand thenpacman -Su, then it would do the update, similar topacman -Syu.
If you didpacman -Syyesterday and then dopacman -Sutoday, then it will update up to yesterday’s packages and will ignore any updates from that point to today.This can be considered analogous to
apt updateandapt upgrade.
If you runapt upgradewithoutapt update, you only upgrade upto the packages that you got until the lastapt update.
If arch used
apt, then in this case, the recommendation would be for never useapt updatewithout usingapt upgraderight after it.Isn’t
pacman -Syuthe recommended way to update anyway? I have always used that o. EndeavourOS and hadn’t any issues.Except for the recent nouveau nvidia driver :/
Yes, but it is also good to know why it is recommended.
You’re correct partial upgrades are unsupported. Arch follows a rolling release model, meaning there are no fixed “versions” of the system. Instead, everything is continuously updated. Each package is built and tested against the current state of the rest of the system in the Arch repositories. That package was compiled against the latest system libraries in the repos, not necessarily the ones on your machine.
Your proposed “workaround” may work if the package is standalone and has few/no dependencies. Again, ArchLinux strongly recommends full system upgrades (pacman -Syu) rather than only reinstalling/upgrading a single package, because library or dependency mismatches can occur if your system is out of sync.
A safer approach may be to use “pacman -S package --needed” which will avoid removing it first and automatically handles dependencies safely.But
pacman -S packageto install a new application is not considered a partial upgrade.
I haven’t used Arch in a decade, but as unstable as Arch is, I don’t think Arch doesn’t have dependencies poorly defined like that.
Say, firefox-1 does not depend on libssl-1, but now you upgrade it to firefox-2, you won’t succeed if you successfully downloaded firefox-2, but failed to download libssl-1, because pacman shall fail, while saying the reason being failed to download all of its dependencies.
If you start with a system with both firefox-1 and libssl-1 installed, upgrading firefox-1 to firefox-2 sure would have no problem, because its dependencies are already fulfilled.
If your system is breaking, it’s probably due to some other issue, but it could not be pacman’s.
It seems like there might be exceptions to the “no partial upgrades” which has not been discussed: you can pin your version of the kernel primarily to give time for packages like zfs to catch up to the latest kernel
What part do you mean is the exception? Pinning a package version will lead to partial upgrades, by logic. So pinning the Kernel isn’t an exception itself, maybe its tolerable because the team tries to make sure this scenario works well? Otherwise I wouldn’t call it “exception”.
When installing on Arch (or a derivative) you should run
sudo pacman -Syu package_nameso it is always up to date.






