Installing pacman breaks dependency replaced by yay
Even though I've been using Arch Linux for a few years now, from time to time, I do run into small issues that are unique to Arch.
One such issue happened when I was trying to upgrade my system, only to be
blocked immediately with some sort of dependency mis-match between pacman and
my favorite Arch User Repository installer of the moment, yay.
Incidentally, I ran into this a while back, resolved it, and then forgot to write a post about it. Fortunately, when I went to upgrade my old laptop, that was over 700 packages behind, I ran into the same thing.
The full error message I was receiving when running yay -Syu was:
error: failed to prepare transaction (could not satisfy dependencies)
:: installing pacman (5.2.1-1) breaks dependency 'pacman<5.1.3' required by yay
As mentioned, this is a weird chicken and egg scenario where yay requires a
certain version of pacman and the system wants to upgrade pacman to a newer
version. Thus, yay blocks the upgrade because it would break it's own
dependency.
I found some unique solutions out there to try to work around this, but since
it's not very frequent of an issue, seeing as I only ran into it once in many
years, it seemed like the best solution would be to simply remove yay,
upgrade, then install yay again.
So that's what I did.
Except this time around, I also ran into a similar issue with some other packages:
error: failed to prepare transaction (could not satisfy dependencies)
:: installing xorgproto (2019.2-2) breaks dependency 'dmxproto' required by libdmx
:: installing xorgproto (2019.2-2) breaks dependency 'xfdgaproto' required by liblibxxf86dga
Before I could worry about getting pacman and yay playing nicely again, I
had to correct the aforementioned issues, by doing the following, which was
posted in the latest news on archlinux.org:
su -c 'pacman -Rdd libdmx libxxf86dga'
After running that, I was able to run the following to remove yay, upgrade the
system and then re-install yay manually from the Arch User Repository:
- Remove
yayby runningpacman -R yay. - Upgrade the system using
pacmanby runningsu -c 'pacman -Syu'. - Grab the latest
PKGBUILDforyayby runningcurl -OJ 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay'. - Build the package and install it by running
makepkg -si.
Not much to it, and more than likely the last two commands are probably in your
shell history since they are the same steps to install yay on a system without
a wrapper for the Arch User Repository already installed.
Worth noting, there was a clever solution where you install yay-bin which gets
you a pre-compiled version of yay. Nothing wrong with that solution, but I
didn't want to introduce another package when I didn't have to.