Rebuild AUR packages after a soname bump blocks the upgrade
Diagnosis is right and pacman -Qmq / the deleted-package comm check against aur.archlinux.org/packages.gz are correct. But the headline command is the wrong shape: yay -S --rebuildall $(pacman -Qmq) is a plain -S with no -u, so it does not advance the blocked upgrade, and rebuilding an AUR package before the repo upgrade lands means rebuilding against the *old* libraries, which is the exact state that broke. The rebuild has to happen in the same transaction as the upgrade (or after it).
Do not solve this by adding the AUR package to IgnorePkg, because that just freezes you into a permanent partial-upgrade state.
Symptom
sudo pacman -Syu or yay -Syu aborts with something like:
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'libfoo.so=5-64' required by my-aur-package
or an AUR-installed program stops launching after a system upgrade with a cannot open shared object file error.
Cause
Repo packages get mass-rebuilt against new library sonames by Arch's build infrastructure. Locally built AUR packages do not, so you are responsible for rebuilding them. The versioned .so dependency recorded in your local AUR package no longer exists.
Fix
Identify your foreign (AUR / locally built) packages:
pacman -Qmq # list all foreign packages
Upgrade the system and rebuild every AUR package in one transaction. This is what unblocks the dependency error:
yay -Syu --rebuildall # or: paru -Syu --rebuild
Just the offending package (after the repo upgrade has gone through):
yay -S --rebuild my-aur-package
Without a helper, as a normal user and never as root (makepkg refuses to run as root):
sudo pacman -Syu # complete the repo upgrade first if it is not blocked
cd /tmp && git clone https://aur.archlinux.org/my-aur-package.git
cd my-aur-package && makepkg -si
If an AUR package blocks the whole upgrade and you do not need it:
sudo pacman -Rns my-aur-package
sudo pacman -Syu
yay -S my-aur-package
Also check whether the package still exists upstream, since deleted ones will never build again:
comm -23 <(pacman -Qqm | sort) <(curl -s https://aur.archlinux.org/packages.gz | gzip -cd | sort)
Verify
sudo pacman -Syu completes, and pacman -Qmq packages all launch. yay -Qua shows no pending AUR updates.