omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy update prompts for sudo password repeatedly instead of caching it

Open ADIBAINS opened this issue 2 months ago • 5 comments

System details

12th Gen Intel i5-12450HX, UHD Graphics, Omarchy 4.0.0.r2304.g7b336b1-1

What's wrong?

Sudo password gets asked over and over during omarchy update — once for pruning the package cache, then again (multiple times) for creating the system snapshot. Sudo doesn't seem to be caching the auth between steps, so I end up typing my password 5+ times in one run. Also got a stray "Sorry, try again." even though the password was correct.

Steps to reproduce:

  1. Run omarchy update
  2. Confirm at the "Ready to update?" screen
  3. Watch it ask for [sudo] password repeatedly across different stages

Expected: one sudo prompt (or sudo -v keeping the session alive) for the whole update, not one per step.

Screenshot attached showing the repeated prompts.

Image

ADIBAINS avatar Sep 27 '26 13:09 ADIBAINS

The fix is already merged in https://github.com/omacom/omarchy/pull/13323

capitalist42 avatar Sep 27 '26 14:09 capitalist42

Still reproduced today on the package edge is actually shipping.

Machine: ThinkPad T14 Gen 6, Intel Core Ultra 7 258V, Arc Graphics 130V/140V (8086:64a0). Omarchy 4.0.0.r2304.g7b336b1-1 (omarchy-dev). That package was built 2026-09-26 03:07 CEST, and after a full omarchy update at 16:47 CEST today pacman -Ss '^omarchy-dev$' still lists it as the current edge package.

#13323 merged 2026-09-26 13:31 UTC, after this package was built. The installed /usr/share/omarchy/bin/omarchy-update does not contain that fix. It still revokes the sudo timestamp on entry, puts the sudo -N wrapper on PATH for the whole run, and calls sudo -k again between phases. There is no single sudo /usr/bin/true plus keepalive.

This run prompted nine times before pacman downloaded a package (/tmp/omarchy-update.log):

  • Prune package cache: 2
  • Create system snapshot: 4
  • Update Arch signing keys: 2
  • Update system packages: 1

Same package version as the original report. The git fix is merged; it has not reached the edge package omarchy update installs.

odcpw avatar Sep 27 '26 14:09 odcpw

Still reproduced on the update that installed the package which contains the fix. The in-flight process never ran that new code.

Host t14, ThinkPad T14 Gen 6 (Intel Core Ultra 7 258V, Arc 130V/140V). Edge. On 2026-09-29 an omarchy update -y started on the previously installed updater and, mid-transaction, installed omarchy-dev 4.0.0.r6689.gb421b1b-1 (built 2026-09-29 15:19 CEST, installed 20:23 CEST).

Bash kept executing the replaced script. While the prompts were happening, the update process's script fd was /usr/bin/omarchy-update (deleted), and its PATH was /usr/share/omarchy/default/omarchy/sudo-no-update:/usr/share/omarchy/bin:/usr/bin:/usr/sbin:/bin:/sbin. Every later sudo was therefore sudo -N, which does not write the credential cache, so each one prompted.

/tmp/omarchy-update.log for that run recorded 10 prompts:

  1. Prune package cache
  2. Create system snapshot (five prompts: list-configs, create, cleanup, limine restore, and one more)
  3. Update Arch signing keys (two)
  4. Update system packages (one)
  5. Migration 1790528634 "Move Elsewhen into Omarchy", via omarchy-pkg-drop elsewhen → sudo -N pacman -Rns --noconfirm elsewhen

The 10th prompt hit sudo: timed out reading password and the update exited 1. elsewhen 1.0.0-2 is still installed. ~/.local/state/omarchy/migrations/ has 1790457067.sh and does not have 1790528634.sh.

The omarchy-update now on disk (r6689) does contain authorize_update: one /usr/bin/sudo /usr/bin/true, a 60s keepalive, and the -N wrapper kept off PATH until the AUR phase. This run is not a test of that path. It only shows that an upgrade which replaces omarchy-update cannot fix the prompts of the process that is already reading the old file.

odcpw avatar Sep 29 '26 18:09 odcpw

Thanks @odcpw for tracking this down. So #13323 is on edge now (r6689+), and the run that installed it was still running the old omarchy-update from the deleted file. That transition run can't benefit from the fix.

@ADIBAINS could you run omarchy update once more now that you're on a build with authorize_update, and confirm it asks for your password only once? If it does, I think this can be closed as fixed by #13323. Migration 1790528634 didn't run because of the aborted run, so it should pick up on that next update too. The remaining channel-switch prompts are tracked in #13415 / #13479.

jandrusk avatar Oct 07 '26 13:10 jandrusk

I checked this against the current quattro (f5006bd). The repeated prompts in this report are fixed there by #13323 (e1614f2bd), which is the same failure #13319 described and was closed for.

On quattro, bin/omarchy-update still clears any earlier sudo timestamp on entry, but it no longer puts the sudo -N wrapper on PATH for the whole run. authorize_update asks once with /usr/bin/sudo /usr/bin/true, and a keepalive refreshes that every 60 seconds. Pruning, the snapshot, the keyring, system packages, migrations, orphan removal and service restarts all use plain sudo against that one authorization, and none of them clears it. Two kinds of prompt remain by design. AUR builds run third-party code, so each of their sudo calls still asks (#14388 covers that). Boot verification follows AUR, but it never calls sudo on x86. So on an x86 machine with no AUR packages, an update should ask once.

The fix is on edge from omarchy-dev r6689. No tagged release has it yet, since v4.0.0 predates it. As @odcpw found, the run that installs r6689 is still executing the old script, so it prompts the old way one last time. The update after that is the first that runs the fix. The stray "Sorry, try again." doesn't come from anything in the update scripts, and I couldn't explain it from the source.

I didn't reproduce this on a worker. Counting prompts needs sudo with a password and a full update, so this conclusion comes from reading the source, not from a run. Codex Medium reviewed it as a second opinion and reached the same reading, though its independence is not guaranteed. It also pointed out that the keepalive stops quietly if a non-interactive sudo is refused, so a sudo policy that refuses one could still bring prompts back. I found nothing in Omarchy's defaults that does that.

What's next: @ADIBAINS, if a run on r6689 or later still asks more than once, the output of grep -c 'password for' /tmp/omarchy-update.log along with pacman -Q omarchy-dev would show which phase. Otherwise the maintainer will decide whether to close this as fixed by #13323.

omarchybot avatar Oct 13 '26 03:10 omarchybot