The thing is, it’s not that this problem can be
fixed by running pacman -Syu, it is that, in half a dozen years of running Arch on several machines, the
only way I could get into this particular failure state was when I ignored every bit of documentation in the name of laziness and did pacman -S thing instead of pacman -Su thing. (Or when I built things from outside the official repos and failed to keep them up to date, but I’m going to guess you’re not running a custom build of Clang, because that is the kind of pain you don’t forget.) Theoretically you
might have caught a short window of inconsistent state on a package mirror, but again, from my experience, it’s
always just a partial upgrade I did with my own hands. (Compared to apt, pacman is awesome, but its willingness to let you do stupid things could use some adjustment.)
On to more constructive advice—if your latest update was in the last couple of weeks, just
pacman -Su
may work to pull your machine forward to a consistent state corresponding to the most recent installed package. If not, you can use the <
https://wiki.archlinux.org/title/Arch_Linux_Archive>: get the last update date by an incantation such as
pacman -Qi | sed -n 's/Install Date *: //p' | xargs -d '\n' -n 1 date -I -d | sort -nu | tail -1
(which I just cooked up, so there are surely better ones, or just look at the tail of /var/log/pacman.log), temporarily replace your /etc/pacman.d/mirrorlist with
Server=https://archive.archlinux.org/repos/YYYY/MM/DD/$repo/os/$arch
and run
pacman -Syu # sic!
Either way, you may see a little bit of breakage (though, in my experience, it’s unlikely), but nothing you wouldn’t have had to deal with when you properly installed your current set of packages in the first place.