I managed to fix this yesterday by reinstalling every package with overwrite and manually deleting /etc/mkinitcpio.d/linux.preset before reinstalling the linux package. Just reinstalling linux with overwrite after deleting linux.preset might have worked on it's own.
Hashed steps as I didn't fully record the output:
pacman -R linux
Error: file xyz is empty, not checked
e.g. usr/bin/ldconfig: File /usr/lib/libQt6Gui.so.6.3.2 is empty, not checked.
pacman -S linux
Error: file xyz exists in filesystem
- Reinstalled linux with --overwrite but I didn't search for the error at the time.
(some error)
- Decided to reinstall every package
pacman -Qqn | pacman -S -
Error: file xyz exists in filesystem
- Reinstalled every package with overwrite
pacman -Qqn | pacman -S --overwrite=* -
- Reinstalled linux with overwrite
(2/3) Updating linux initcpios...
==> WARNING: Preset file `/etc/mkinitcpio.d/linux.preset' is empty or does not contain any presets.
(3/3) Refreshing PackageKit...
Error connecting: Could not connect: No such file or directory
error: command failed to execute correctly
sudo rm /etc/mkinitcpio.d/linux.preset