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


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, using
pacman -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 use
pacman -Syand thenpacman -Su, then it would do the update, similar topacman -Syu.If you did
pacman -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 run
apt 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 to 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.