Skip to content

Conversation

@scale03
Copy link
Contributor

@scale03 scale03 commented Dec 21, 2025

WHY

This PR addresses a recurring failure during the omarchy-update process where yay crashes the system update.
Fixes #3917

The Problem

When updating AUR packages, yay attempts to reuse existing git repositories in ~/.cache/yay/. If a previous download was interrupted or the directory is corrupted, git fails because the "destination path already exists and is not an empty directory."

Because the script uses the --noconfirm flag, yay cannot prompt the user to clean the directory and instead exits with a fatal error, having the user to manually remove the path.

The Fix

Added the --cleanafter flag to the yay command. This ensures that:

  1. Build directories are removed immediately after a successful system update.
  2. The system state remains clean for future update cycles.
  3. The update process becomes idempotent, preventing stale state conflicts.

Verification:

image image Verified it removes only cache only after successfull installations/update.

The use of `--noconfirm` in AUR updates causes fatal exits during system updates, when the git destination path in `~/.cache/yay/` is non-empty or corrupted. 
Adding `--cleanafter` ensures that build directories are removed after successful installations, making the update process idempotent and preventing stale state conflicts in future runs.
@scale03 scale03 changed the base branch from master to dev December 21, 2025 16:10
@dhh
Copy link
Member

dhh commented Dec 22, 2025

I don't follow fully here. You write:

When updating AUR packages, yay attempts to reuse existing git repositories in ~/.cache/yay/. If a previous download was interrupted or the directory is corrupted, git fails because the "destination path already exists and is not an empty directory."

But the change you've made is to the pacman step, not to the yay step? AUR is only processed with the yay step, no?

@scale03
Copy link
Contributor Author

scale03 commented Dec 22, 2025

@dhh I mistakenly applied the flag to the pacman command instead of yay. I've just updated the PR to move the --cleanafter flag to the correct step, which is where the git cache conflicts occur. Thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants