打开酒桶：“自酿啤酒” 4.0.0 版来了
Homebrew

> 
> 用于 macOS（如果你需要的话，也包括 Linux）的附加软件包管理器。
> 
> 
> 


![](/data/attachment/album/202302/28/233857ecxyr0hizuox5b3h.jpg)


如果你在 Mac 上的终端窗口工作，Homebrew 是一个方便的工具，它可以让你快速、轻松地安装广泛的 FOSS 世界中各种熟悉的工具。


这个附加的软件包管理器不需要超级用户权限，可以将程序安装到你的主目录中：它 “[对 macOS 的作用就像 apt-get 对 Debian 的作用](https://www.theregister.com/2018/08/08/researcher_found_homebrew_github_token_hidden_in_plain_sight/)”。新版本 [4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/) 比以前更快，特别是在更新过程中。自动更新现在每天运行一次，而不是像 3.6 版那样每 5 分钟一次。虽然支持各种 Linux 发行版 —— 其基本要求非常宽松，内核 3.2 或更新版本，以及 Glibc 2.13 或更新版本 —— 但新版本不再正式支持 WSL1。


![pint-sized contributers](/data/attachment/album/202302/28/233911rggxev1tsqdsv22w.jpg "pint-sized contributers")


*Homebrew 团队合影，包括 “冒泡啤酒” —— 项目负责人 Mike McQuaid*


尽管 macOS 有 FOSS 的 [基础](https://opensource.apple.com/releases/)，但苹果公司的产品是针对 Mac 用户设计的，他们倾向于生活在一个图形化的、点击式的世界里。这可能会让来自 Linux 的移民感到困惑：尽管 Mac 的终端环境继承了很多表面上看起来熟悉的来自 FreeBSD 的工具，但它们往往是过时的版本，或者有细微的不同。Linux 用户期望能够仅仅通过 `apt` 安装 python-3.11 或类似的工具。


这正是 Homebrew 被设计来解决的问题：安装 Homebrew 包，然后你输入 `brew install python@3.11` 就可以了。而且，至关重要的是，如果你在 macOS 上安装一个新版本的 Python，你可能会破坏操作系统的其他部分，而使用 Homebrew，你安装的任何东西都是你自己的 —— 它不会影响整个操作系统，也不会影响任何其他用户。


Homebrew 最初是为 macOS 建立的，但事实证明这个概念对 Linux 用户也很有用。你可能没有机器的 root 权限 —— 或者即使你有，那也可能只让你安装古老的版本，这些版本没有什么帮助，但你不能轻易更新。


该项目负责人 Mike McQuaid —— 当 Reg FOSS 部门的人在 FOSDEM 上见到他时，他正 [穿着](https://brew.sh/assets/img/blog/fosdem_2023.jpg) 华丽的衣服，像一杯冒泡的啤酒 —— 告诉我们：



> 
> Linux 上的 Homebrew 曾经是一个被称为 “Linuxbrew” 的独立复刻。但随着时间的推移，到了如今这些努力和我们已经完全是一个项目了，共享我们的团队和基础设施等等。
> 
> 
> 它最初的用途是在高端生物信息学机器上，用户没有 root 权限来使用系统的软件包管理器，但想在该机器上从软件包管理器安装新的软件。
> 
> 
> 


以前独立的 Linuxbrew 复刻早在 2019 年就被 [并入](https://brew.sh/2019/01/09/homebrew-1.9.0/) 了主项目的 1.9 版本。McQuaid 解释说，Homebrew 项目一些特异的 [术语](https://docs.brew.sh/Formula-Cookbook#homebrew-terminology)，例如，“<ruby> 酒桶 <rp>  （ </rp> <rt>  cask </rt> <rp>  ） </rp></ruby>” 和 “<ruby> 水龙头 <rp>  （ </rp> <rt>  tap </rt> <rp>  ） </rp></ruby>”，都源自于合并的各种项目：



> 
> Homebrew Cask 是一个独立的项目（现在基本上已经统一），允许 Homebrew 用于安装闭源软件的上游二进制包（相比之下，我们的主仓库 homebrew-core 只允许我们从源头构建自己的二进制的开源软件），例如 Chrome、Firefox 等。
> 
> 
> Homebrew 的 “我们从源代码构建” 的描述文件被称为 “<ruby> 配方 <rp>  （ </rp> <rt>  formulae </rt> <rp>  ） </rp></ruby>”，我们用它构建我们的二进制包，“<ruby> 瓶子 <rp>  （ </rp> <rt>  bottle </rt> <rp>  ） </rp></ruby>”。
> 
> 
> Homebrew 的 “分发上游二进制文件” 的描述文件被称为 “<ruby> 酒桶 <rp>  （ </rp> <rt>  cask </rt> <rp>  ） </rp></ruby>”。
> 
> 
> 


Homebrew 也可以在 Windows 10 或 11 上的 WSL 内工作，尽管在版本 4 中只支持 WSL2。它支持 Debian 和 Red Hat 家族的发行版，包括 Ubuntu、CentOS 和 RHEL，可以运行在 x86-64 和 Arm 32/64 机器上。




---


via: <https://www.theregister.com/2023/02/27/homebrew_version_4_is_here/>


作者：[Liam Proven](https://www.theregister.com/Author/Liam-Proven) 译者：[wxy](https://github.com/wxy) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](/article-15580-1.html) 荣誉推出


OK
This article is more than **1 year old**

# Pop open a cask: Homebrew version 4.0.0 is here

## Add-on package manager for macOS (and Linux if you need it)

FOSS Fest Homebrew is a handy tool if you work in a terminal window on a Mac, which lets you quickly and easily install a wide variety of familiar tools from the wider FOSS world.

The add-on package manager doesn't need superuser permissions and installs programs into your home directory: it ["does for macOS what apt-get does for Debian"](https://www.theregister.com/2018/08/08/researcher_found_homebrew_github_token_hidden_in_plain_sight/). The new

[version 4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/)is faster than before, especially when it comes to the update process. Automatic updates now run daily, rather than every five minutes as in version 3.6. While various Linux distros are supported – the basic [requirements] are a very modest kernel 3.2 or newer, and Glibc 2.13 or newer – the new version no longer officially supports WSL1.

Although macOS has FOSS [foundations](https://opensource.apple.com/releases/), Apple's offering is aimed at, well, Mac users, who tend to live in a graphical, point-and-click world. This can be disorienting to migrants from Linux: although the Mac's terminal environment inherits a lot of ostensibly-familiar tools from its roots in FreeBSD, they are often elderly versions, or are subtly different. Linux folks expect to just be able to `apt install python-3.11`

or the like.

This is what Homebrew was designed to fix: install the Homebrew package, and then you can type `brew install python@3.11`

and you're off. And, crucially, while if you install a new version of Python on macOS you might break other bits of the OS, with Homebrew, anything you install is yours alone – it won't affect the OS as a whole, or any other users.

Homebrew was originally built for macOS, but the concept proved useful for Linux users, too. Either you may not have root access to the machine – or even if you do, that may only let you install ancient versions which aren't much help, but you can't readily update.

[Apple splats zero-day bug, other gremlins in macOS, iOS](https://www.theregister.com/2023/02/15/apple_patches_zeroday_vulnerability/)[Microsoft hijacks Google's Chrome download page to beg you not to ditch Edge](https://www.theregister.com/2023/02/23/microsoft_edge_banner_chrome/)[Open source software has its perks, but supply chain risks can't be ignored](https://www.theregister.com/2023/02/22/open_software_supply_chain_risks/)[Researcher found Homebrew GitHub token hidden in plain sight](https://www.theregister.com/2018/08/08/researcher_found_homebrew_github_token_hidden_in_plain_sight/)

Project lead Mike McQuaid, who when the *Reg* FOSS desk met him at FOSDEM was resplendently [dressed](https://brew.sh/assets/img/blog/fosdem_2023.jpg) as a foaming pint, told us:

Homebrew on Linux used to be a separate fork known as "Linuxbrew". Over time, these efforts have got to where we are today, where we're entirely one project and share our team, infrastructure etc.

The original usage was on high-end bioinformatics machines where the users did not have root access to use the system package manager, but wanted to install new software from a package manager on that machine.


The formerly separate Linuxbrew fork was [merged](https://brew.sh/2019/01/09/homebrew-1.9.0/) into version 1.9 of the main project back in 2019. McQuaid explained that some of the project's idiosyncratic [terminology](https://docs.brew.sh/Formula-Cookbook#homebrew-terminology) (for example, "casks" and "taps") dates to various project merges:

Homebrew Cask was a separate project (now mostly unified) to allow Homebrew to be used to install upstream binary packages for closed-source software (in comparison,

`homebrew-core`

, our main repository, only allows open source software that we build our own binaries for from source) e.g. Google Chrome, Firefox, etc.Homebrew's "we build from source" description files are called "formulae" (from which we build our binary packages, "bottles").

Homebrew's "distribute upstream binaries" description files are called "casks".


Homebrew also works inside WSL on Windows 10 or 11, although in version 4, only WSL2 is supported. It supports Debian- and Red Hat-family distros if you need it, including Ubuntu, CentOS and RHEL, on x86-64 and both 32-bit and 64-bit Arm boxes. ®

12