Files
omarchycn/bin/omarchy-update-system-pkgs
T
David Heinemeier HanssonandClaude Fable 5 844859a000 Always overwrite unowned strays under /usr/share/omarchy on update
The tree is wholly package-owned, but files can land there unowned
(in-place extension work, script-written files), and pacman then aborts
the entire upgrade on the file conflict — as happened when copy-url's
service worker was renamed to background-2.js. The conflict check runs
before any hooks or scriptlets, so the package itself can't recover;
the update command has to allow the overwrite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 21:31:10 -07:00

45 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Update system packages with pacman
# omarchy:requires-sudo=true
set -e
echo -e "\e[32m\nUpdate system packages\e[0m"
# Transition --overwrite: previous script-installed Omarchy wrote these paths
# as unowned files; pacman would refuse the omarchy-settings upgrade on first
# encounter. Drop each entry once the transition release is the baseline.
#
# The /usr/share/omarchy/* entry is permanent: that tree is wholly owned by
# the omarchy packages, but files can land there unowned (in-place extension
# work, script-written files), which would abort the whole upgrade. Packaged
# content always wins there.
sudo env OMARCHY_UPDATE_PACMAN=1 pacman -Syu --noconfirm \
--overwrite '/etc/docker/daemon.json' \
--overwrite '/etc/gnupg/dirmngr.conf' \
--overwrite '/etc/mkinitcpio.conf.d/omarchy_hooks.conf' \
--overwrite '/etc/mkinitcpio.conf.d/thunderbolt_module.conf' \
--overwrite '/etc/modprobe.d/omarchy-usb-autosuspend.conf' \
--overwrite '/etc/sddm.conf.d/10-theme.conf' \
--overwrite '/etc/sddm.conf.d/10-wayland.conf' \
--overwrite '/etc/sudoers.d/omarchy-asdcontrol' \
--overwrite '/etc/sudoers.d/omarchy-passwd-tries' \
--overwrite '/etc/sudoers.d/omarchy-tzupdate' \
--overwrite '/etc/sysctl.d/90-omarchy-file-watchers.conf' \
--overwrite '/etc/sysctl.d/99-omarchy-sysctl.conf' \
--overwrite '/etc/systemd/logind.conf.d/10-ignore-power-button.conf' \
--overwrite '/etc/systemd/resolved.conf.d/10-disable-multicast.conf' \
--overwrite '/etc/systemd/resolved.conf.d/20-docker-dns.conf' \
--overwrite '/etc/systemd/system.conf.d/10-faster-shutdown.conf' \
--overwrite '/etc/systemd/system/user@.service.d/10-faster-shutdown.conf' \
--overwrite '/etc/systemd/system/docker.service.d/no-block-boot.conf' \
--overwrite '/etc/systemd/system/plocate-updatedb.service.d/ac-only.conf' \
--overwrite '/etc/systemd/system.conf.d/20-omarchy-nofile.conf' \
--overwrite '/etc/systemd/user.conf.d/20-omarchy-nofile.conf' \
--overwrite '/usr/lib/systemd/system-sleep/unmount-fuse' \
--overwrite '/usr/share/plymouth/themes/omarchy/*' \
--overwrite '/usr/share/sddm/hyprland.lua' \
--overwrite '/usr/share/sddm/themes/omarchy/*' \
--overwrite '/usr/share/omarchy/*'