百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

homebrew-autoupdate

> 编程语言
开源

:tropical_drink: 一种简单、方便的方法来自动更新 Homebrew。

1.5K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

:tropical_drink: 一种简单、方便的方法来自动更新 Homebrew。

Homebrew Autoupdate

An easy, convenient way to automatically update Homebrew.

This script will run brew update in the background once every 24 hours (by default) until explicitly told to stop, utilising launchd.

brew upgrade and brew cleanup can also be handled automatically, but are optional flags.

Notifications are enabled by default using a code-signed, universal macOS app. Pass --notify-on-error to suppress successful-run notifications, or --no-notify to disable notifications entirely.

Installing this command

Tap the repository and trust its external command:

brew tap domt4/autoupdate
brew trust --command domt4/autoupdate/autoupdate

Homebrew is moving towards requiring explicit trust before loading commands from non-official taps. Command-scoped trust is recommended here because it permits only brew autoupdate; it does not trust every current or future formula, cask, or command in this tap.

Existing users who see an untrusted tap warning can run the brew trust command above. When trust enforcement is enabled, an already installed launch agent will continue running its scheduled built-in brew update, upgrade, and cleanup commands. Management commands such as brew autoupdate status, stop, or delete will be unavailable until autoupdate is trusted.

See Homebrew's tap trust documentation and issue #222 for background.

Now run brew autoupdate start [interval] [options] to enable autoupdate. The interval defaults to 24 hours and accepts seconds or a short duration such as 30m, 12h, or 1d, or a 24-hour clock time such as 00:00 to run daily at that specific time instead of relative to when the command was run.

Note: To ensure that auto-updated cask-based apps are updated in place (so they stay on your Dock), add ~/Library/Application Support/com.github.domt4.homebrew-autoupdate/brew_autoupdate to System Settings / Privacy and Security / App Management. (Also allow ruby and Terminal.app)

Example

brew autoupdate start 12h --upgrade --cleanup --immediate --sudo

This will upgrade all your casks and formulae every 12 hours and on every system boot. If a sudo password is required for an upgrade, a GUI to enter your password will be displayed. Also, it will clean up every old version and left-over files.

Casks that have built-in auto-updates enabled by default will not be upgraded.

Upgrade Only Specific Packages

brew autoupdate start 12h --upgrade --only=wget,node,firefox

This will only auto-upgrade wget, node, and firefox every 12 hours, leaving all other installed packages untouched. Both formulae and casks are supported, including tap-qualified names (homebrew/cask/firefox) and versioned formulae (node@20).

Cannot be combined with --leaves-only. To change which packages are auto-upgraded, run brew autoupdate delete then start again with the new list.

Run at a specific time every day

brew autoupdate start 00:00 --upgrade --cleanup

Instead of a duration, pass a 24-hour clock time (HH:MM) to schedule the run via launchd's StartCalendarInterval at that exact wall-clock time every day, rather than a relative interval measured from whenever the command was run (which drifts and won't line up with midnight, or any other fixed time, over repeated runs).

Usage

…

Logs of the performed operations can be found at: ~/Library/Logs/com.github.domt4.homebrew-autoupdate

This vs brew's built-in autoupdate mechanism

This command mostly exists to ensure Homebrew is updated regardless of whether you invoke brew or not, which is the primary difference from the autoupdate mechanism built into brew, the latter requiring a user to explicitly run any of brew install, brew tap or brew upgrade.

If you run brew commands regularly yourself, you may wish to consider using the built-in autoupdate mechanism, which can be instructed to autoupdate less often, or disabled entirely. If you wish to update every 24 hours using the built-in autoupdate mechanism set this in your environment:

export HOMEBREW_AUTO_UPDATE_SECS="86400"

or if you wish to disable the built-in autoupdate mechanism entirely:

export HOMEBREW_NO_AUTO_UPDATE="1"

Please note that Homebrew slightly frowns upon people disabling the built-in autoupdate mechanism.

TO-DO (PRs Welcome)

History

This tap was created by DomT4 in April 2015 to address a personal desire for a background updater, before being moved to the Homebrew organisation in April 2021 to become an official part of the project after gaining somewhat widespread usage, something I'm both surprised by, but also very appreciative of people finding a small tool I wrote so useful & contributing their own ideas and time towards.

It was in late 2023 moved back to DomT4's ownership to reduce the burden on the wider Homebrew leadership team in terms of maintenance/support requests.

License

Code is under the BSD 2 Clause (NetBSD) license.

Issues· 7 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyhomebrewhomebrew-autoupdateruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言