OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
pacman-aur medium common DISPUTE

Stop omarchy-update wiping custom repositories from pacman.conf

omarchyarchdesktoplaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Checked on this Omarchy 4.0.2 machine: pacman -Qo /etc/pacman.conf reports pacman 7.1.0 owns it and pacman -Qii pacman lists it as a backup file marked [modified], so a pacman package upgrade writes a .pacnew and never overwrites it. omarchy-settings 4.0.2 owns no file under /etc/pacman* (its only backup file is /etc/fastfetch/config.jsonc), it ships the templates in /usr/share/omarchy/default/pacman/ and the hook sample. Read /usr/share/omarchy/bin/omarchy-update, omarchy-update-system-pkgs, omarchy-channel-set and omarchy-refresh-pacman locally and against the quattro tree: omarchy update never calls omarchy-refresh-pacman, only omarchy refresh pacman and omarchy channel set do, and none of the 96 migrations shipped in 4.0.2 nor the 13 newer ones on quattro call it (two migrations sed-edit the [omarchy] section only). The record's symptom is the Omarchy 3 behaviour: on the master branch six migrations call omarchy-refresh-pacman, which is what issue 3497 (Omarchy 3.2.0, 2025-11-21) hit, so that issue supports the claim for Omarchy 3 only. Commit c8661403 (2025-11-22) added the .bak copies, and commit c4dbf129 (2026-05-11, PR #5681) added the omarchy-hook pre-refresh-pacman call between the copy and pacman -Syyuu, with a sample at ~/.config/omarchy/hooks/pre-refresh-pacman.d/add-custom-repo.sample that Omarchy installs from /etc/skel (present in this home). That hook is the supported way to keep a custom repo, and the record's ~/.config/omarchy/extra-repos.conf plus manual grep/tee is an invented mechanism nothing reads. The record's sudo pacman -Syu is blocked by the ALPM update guard on Omarchy 4 and is redundant anyway because omarchy-refresh-pacman runs pacman -Syyuu itself after the hook. The cited master raw URLs still return 200 but are the Omarchy 3 tree. Not exercised: I did not run omarchy-refresh-pacman or the hook, no .bak exists on this machine, and the exact sed placement was read from the sample, not executed.

The cause above was rewritten on 2026-09-07 to match this note; the fix was corrected by the audit itself.
RISK

Only ONE level of backup is kept: omarchy-refresh-pacman overwrites /etc/pacman.conf.bak and /etc/pacman.d/mirrorlist.bak on every run, and omarchy channel set runs it every time, so a second refresh loses the original. omarchy-hook prints Hook failed: <path> and carries on when a hook exits non-zero, so a broken hook lets pacman -Syyuu run without your repositories and packages from them stop updating silently. Mixing third-party repos (CachyOS, Chaotic-AUR) with Omarchy's own mirror can deliver packages from different snapshots and cause partial-upgrade breakage, and a repo included above [core] wins over core for same-named packages.

Symptom

Custom repositories you added to /etc/pacman.conf (CachyOS, Chaotic-AUR, a local repo) and your mirror list vanish after omarchy refresh pacman or omarchy channel set <stable|rc|edge> (Omarchy 4), or after an omarchy-update whose migration reset pacman (Omarchy 3, issue 3497 on 3.2.0: "I have added CachyOS repos into pacman.conf and mirrorlist, but Omarchy-Update just replaced it out of a sudden!"). Packages installed from those repos then show as foreign in pacman -Qm and no longer update. A plain omarchy update on Omarchy 4 does not touch /etc/pacman.conf.

Cause

/usr/share/omarchy/bin/omarchy-refresh-pacman copies /etc/pacman.conf to /etc/pacman.conf.bak and /etc/pacman.d/mirrorlist to /etc/pacman.d/mirrorlist.bak, then does sudo cp -f $OMARCHY_PATH/default/pacman/pacman-<channel>.conf /etc/pacman.conf and the same for mirrorlist-<channel>. It is a wholesale overwrite, not a merge. On Omarchy 4 it runs only from omarchy refresh pacman and omarchy channel set (which calls it and then omarchy update -y). omarchy update itself never calls it and no shipped 4.x migration does. On Omarchy 3 several migrations called it, so a routine omarchy-update could reset the file. /etc/pacman.conf is owned by the pacman package as a backup file, so a package upgrade produces /etc/pacman.conf.pacnew instead of overwriting, and omarchy-settings owns nothing under /etc/pacman*. Since 2026-05-11 the script runs the user hook ~/.config/omarchy/hooks/pre-refresh-pacman (and pre-refresh-pacman.d/*) after the copy and before pacman -Syyuu, which is where custom repositories are meant to be re-added.

Fix

Recover what was there. The script keeps one backup of each file:


sudo diff -u /etc/pacman.conf.bak /etc/pacman.conf
sudo diff -u /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist

Omarchy 4: keep your repositories in a snippet and let the shipped hook re-add them on every refresh or channel switch. Put the repo sections in /etc/pacman.d/custom-repos.conf:


sudo tee /etc/pacman.d/custom-repos.conf >/dev/null <<'EOF'
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
EOF

Enable the sample hook Omarchy installed in your home (it inserts Include = /etc/pacman.d/custom-repos.conf above [core], so those repos take priority. Edit the sed line in the hook if you want them after [omarchy] instead):


cd ~/.config/omarchy/hooks/pre-refresh-pacman.d
mv add-custom-repo.sample add-custom-repo
chmod +x add-custom-repo

If the sample is missing, copy it from /usr/share/omarchy/config/omarchy/hooks/pre-refresh-pacman.d/add-custom-repo.sample. Apply it now without waiting for the next refresh:


bash ~/.config/omarchy/hooks/pre-refresh-pacman.d/add-custom-repo
omarchy update

Do not run sudo pacman -Syu on Omarchy 4: the update guard aborts it, and omarchy refresh pacman already runs pacman -Syyuu after the hook.

Omarchy 3 or plain Arch (no hook mechanism): re-append the section to the fresh file and sync:


sudo tee -a /etc/pacman.conf >/dev/null <<'EOF'

[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
EOF
sudo pacman -Syu

Verify

pacman-conf --repo-list lists your custom repo alongside core/extra/multilib/omarchy, and sudo pacman -Syu syncs its database.

Sources

omarchy-update-overwrites-pacman-conf