Skip to content

fix(auto-updates): replace nonexistent brew autoupdate with LaunchAgent#58

Merged
smartwatermelon merged 2 commits intomainfrom
claude/fix-auto-updates-brew-launchagent-1770935696
Feb 12, 2026
Merged

fix(auto-updates): replace nonexistent brew autoupdate with LaunchAgent#58
smartwatermelon merged 2 commits intomainfrom
claude/fix-auto-updates-brew-launchagent-1770935696

Conversation

@smartwatermelon
Copy link
Owner

Summary

  • Replace brew autoupdate (requires third-party DomT4/homebrew-autoupdate tap) with a native LaunchAgent that runs brew update && brew upgrade && brew cleanup daily at 04:30
  • Fix all three auto-update sections to actually load their LaunchAgent/Daemon after creation instead of logging "To activate:" hints
  • Update docs to match new verification commands

Details

brew autoupdate is not a built-in Homebrew subcommand. The original implementation assumed it was, with a fallback to brew tap domt4/autoupdate. Neither path works without installing the third-party tap first.

The fix creates a simple wrapper script + LaunchAgent (same pattern as the existing MAS section), handling Apple Silicon Homebrew environment setup (eval brew shellenv).

Test plan

  • Deploy to server: scp scripts/server/setup-auto-updates.sh andrewrich@tilsit.local:/tmp/server-setup/scripts/
  • Run on server: ./scripts/setup-auto-updates.sh --force
  • Verify: launchctl list | grep brew-upgrade
  • Verify: launchctl list | grep mas
  • Verify: sudo launchctl list | grep softwareupdate

🤖 Generated with Claude Code

Claude Code Bot and others added 2 commits February 12, 2026 14:38
`brew autoupdate` is not a built-in Homebrew command — it requires the
third-party DomT4/homebrew-autoupdate tap. Replace with a native
LaunchAgent + wrapper script that runs `brew update && brew upgrade &&
brew cleanup` daily at 04:30.

Also fix all three sections to actually load their LaunchAgent/Daemon
after creation instead of just logging a hint. The idempotency check
now ensures the agent is loaded even on re-runs.

The wrapper script handles Apple Silicon Homebrew environment setup
(eval brew shellenv) which is required for LaunchAgent context where
PATH doesn't include /opt/homebrew/bin by default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Some cask upgrades invoke sudo for .pkg installers. In a LaunchAgent
context with no TTY, sudo blocks forever. Fix:

- Set SUDO_ASKPASS=/bin/false so sudo fails immediately
- Split upgrade into --formula then --cask so a cask needing sudo
  doesn't block formula upgrades
- Set HOMEBREW_NO_AUTO_UPDATE=1 since we run brew update explicitly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smartwatermelon
Copy link
Owner Author

Seer finding addressed: The hardcoded /opt/homebrew path is correct — this project exclusively targets Apple Silicon Mac Minis. The same path is used throughout the codebase (line 116 of this file, MAS section, and other setup scripts). Not a real issue.

@smartwatermelon smartwatermelon merged commit 283b00b into main Feb 12, 2026
17 checks passed
@smartwatermelon smartwatermelon deleted the claude/fix-auto-updates-brew-launchagent-1770935696 branch February 12, 2026 22:52
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.

1 participant