Resolve a 'conflicting files, exists in filesystem' upgrade abort
Checked against the Arch wiki Pacman page section 'Failed to commit transaction (conflicting files)', the System_maintenance page ('Generally avoid using the --overwrite option', glob argument), the pacman(8) man page on this machine (--overwrite <glob>, comma-separated patterns, may be repeated, negation with !), and pacman source: src/pacman/sync.c prints pkg: /path exists in filesystem for an unowned file and ... exists in filesystem (owned by other) when another package owns it, and lib/libalpm/conflict.c line 533 treats a path listed in the local db entry of the same package as not a conflict. That last point is what breaks the record's Case B: a file that pacman -Qo attributes to the very package being upgraded cannot produce this error, and when the package's /var/lib/pacman/local/<pkg>-<ver>/files list is empty or corrupt (the record's own cause), -Qo reports 'No package owns' exactly as in Case A, because -Qo reads that same list. The corrected fix tells Case A and Case B apart with pacman -Ql some-package and the local db files list, and Case C by the '(owned by ...)' suffix. Second defect: every upgrade command in the fix and the verify is sudo pacman -Syu, which the 00-omarchy-update-guard.hook PreTransaction hook (read at /usr/share/libalpm/hooks/) aborts on Omarchy 4. Third, Omarchy 4 already handles part of this case and the record does not say so: /usr/share/omarchy/bin/omarchy-update-system-pkgs (read here, omarchy 4.0.2-1) runs pacman -Syu --noconfirm --overwrite '/usr/share/omarchy/*', and on failure hands the error report to omarchy-update-system-pkgs-when-conflicted, which moves unowned paths reported for omarchy, omarchy-dev, omarchy-settings or omarchy-settings-dev to /var/lib/omarchy/replaced/<path> and retries, but only when every 'exists in filesystem' line is one of those. Conflicts from any other package stop omarchy update. The scoped-glob advice and the single-quoting are correct and kept. pacman -S --overwrite ... pkg without -u is not blocked by the guard, confirmed by reading omarchy-update-pacman-guard. Not exercised: no conflict was induced on this machine and pacman -Ql on a package with an emptied files list was not run, so that -Ql prints nothing in that state is inferred from -Qo and -Ql reading the same local db list.
pacman --overwrite '*' (or --overwrite '/*') is the classic way to destroy an Arch install. It can clobber the initramfs and kernel files and leave the machine with "Unable to find root device" at boot. Always scope the glob to the exact path in the error.
Symptom
An upgrade aborts with:
error: failed to commit transaction (conflicting files)
some-package: /usr/lib/something.so exists in filesystem
Errors occurred, no packages were upgraded.
Cause
pacman never overwrites a file it does not own. The file was either put there by make install / a manually extracted tarball / a curl-installed tool, or the package's own file list at /var/lib/pacman/local/<pkg>-<ver>/files is corrupt or empty.
Fix
Find out who owns the offending file before touching anything, and read the error line carefully: an unowned file prints pkg: /path exists in filesystem, a file owned by another package prints pkg: /path exists in filesystem (owned by other-pkg).
pacman -Qo /usr/lib/something.so
pacman -Ql some-package | head
**Omarchy 4 first:** omarchy update already runs pacman with --overwrite '/usr/share/omarchy/*', and when every conflicting path is unowned and reported for omarchy, omarchy-settings or their -dev variants, its conflict handler (omarchy-update-system-pkgs-when-conflicted) moves them to /var/lib/omarchy/replaced/<original path> and retries by itself. So if this error survives omarchy update, the file belongs to some other package's path. Resolve it with one of the cases below, then rerun omarchy update. Do not rerun with sudo pacman -Syu: the Omarchy update guard hook aborts it.
**Case A: No package owns and pacman -Ql some-package still lists files.** A stray file that make install, a tarball or a curl-installed tool put there. Rename it out of the way and rerun the upgrade.
sudo mv /usr/lib/something.so /usr/lib/something.so.bak
omarchy update # Omarchy 4
sudo pacman -Syu # plain Arch
# once the upgrade succeeds and things work:
sudo rm /usr/lib/something.so.bak
**Case B: No package owns but pacman -Ql some-package prints nothing, or /var/lib/pacman/local/some-package-<ver>/files is empty or missing.** The package's own file list is corrupt, so pacman no longer knows it owns those files and reports every one of them as conflicting. -Qo cannot tell this apart from Case A because it reads the same list. Reinstall the package with an overwrite scoped to exactly the paths in the error. Single quotes stop the shell expanding the glob. Several paths are comma-separated or given with repeated --overwrite:
sudo pacman -S --overwrite '/usr/lib/something.so' some-package
sudo pacman -S --overwrite '/usr/lib/something.so,/usr/lib/other.so' some-package
This is a plain -S with no -u, so the Omarchy guard does not block it, and it does not refresh the sync database, so it is not a partial upgrade.
**Case C: the line ends in (owned by other-package).** Two packages ship the same path. That is a packaging bug: check the Arch news and the package's bug tracker, report it, and do not force it. Never use --overwrite with a bare '*' or '/*'.
Verify
The upgrade completes with no conflicting files errors (omarchy update on Omarchy 4, sudo pacman -Syu on plain Arch), and pacman -Qkk some-package reports 0 missing and 0 altered files.