# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 lego

查看 lego 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:lego
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install lego
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lego
```

  证据: MacPorts ports tree: security/lego/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add lego
```

  证据: Alpine Linux edge package indexes: lego from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install lego
```

  证据: Debian stable package indexes: lego from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install lego
```

  证据: Fedora Rawhide package metadata: lego from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#lego
```

  证据: nixpkgs package indexes: pkgs/by-name/le/lego/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S lego
```

  证据: Arch Linux sync databases: lego from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install lego
```

  证据: openSUSE Tumbleweed package metadata: lego from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/lego
```

  证据: Scoop official bucket manifest trees: bucket/lego.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id GoACME.lego -e
```

  证据: Windows Package Manager source index: GoACME.lego from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:lego
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/lego>
- **版本:** 5.3.1
- **来源摘要:** Let's Encrypt client and ACME library
- **主页:** <https://go-acme.github.io/lego/>
- **仓库:** <https://github.com/go-acme/lego>
- **上游文档:** <https://go-acme.github.io/lego/>
- **许可证:** MIT
- **源码归档:** <https://github.com/go-acme/lego/archive/refs/tags/v5.3.1.tar.gz>
- **最后更新:** 2026-07-26T13:41:01+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- lego (cli)
- lego (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 5.3.1
- 管理器更新时间: 2026-07-26
- 本地数据: OK
- 上游仓库: https://github.com/go-acme/lego
- 检测到的最新版本: v5.3.1 (当前)
## 项目历史与用法

Lego is an ACME client and Go library for obtaining, renewing, and revoking certificates from Let's Encrypt and other ACME certificate authorities.

### 项目历史

The project began in 2015, before Let's Encrypt's public beta and before ACME became an RFC. A maintainer discussion explains that lego started around the need to make HTTPS automatic in a Go web-server project, at a time when Certbot still had a different name and ACME client tooling was experimental.

Lego evolved into both a command-line client and an embeddable Go library. Its docs emphasize support for ACME v2/RFC 8555, multiple ACME servers, HTTP-01, DNS-01, TLS-ALPN-01, DNS-PERSIST-01, wildcard and SAN certificates, and a large DNS-provider integration matrix.

### 采用历史

Lego's package-manager adoption is broad because certificate automation needs simple deployment on servers, containers, NAS devices, and CI hosts. The Homebrew, Debian, Ubuntu, Alpine, Arch, MacPorts, Nix, Scoop, winget, and zypper package presence in the input mirrors that role: it is a practical infrastructure binary rather than a language-only library.

### 使用方式

Users commonly call `lego run` or `lego renew` with an email, domains, and a challenge method. DNS-01 support is especially important for wildcard certificates and machines that cannot expose HTTP challenges; the docs maintain per-provider credential and environment-variable pages for that integration surface.

### 为什么软件包爱好者会关心

Lego is package-nerd significant because it turned the messy edge of ACME automation into a portable Go binary with hundreds of provider integrations. It also became a library substrate for other Go programs that wanted certificate automation without shelling out to Certbot.

### 时间线

- 2015: The project started before Let's Encrypt's public beta.
- 2015-12-03: Dependency metadata records lego v0.1.0.
- 2019-03: RFC 8555 standardized ACME v2.
- 2024-09-05: The project disclosed GHSA-q82r-2j7m-9rv4 for HTTPS enforcement in ACME API use.
- 2026-05: Official docs listed more than 200 DNS providers.

### Related projects

- Related ACME clients include Certbot, acme.sh, dehydrated, Caddy's automatic HTTPS stack, Traefik's ACME support, win-acme, and Boulder, the Let's Encrypt CA software. Related standards include ACME RFC 8555 and challenge specifications such as HTTP-01, DNS-01, and TLS-ALPN-01.

### 来源

- <https://deps.dev/go/github.com%2Fgo-acme%2Flego/v2.7.2%2Bincompatible>
- <https://github.com/advisories/GHSA-q82r-2j7m-9rv4>
- <https://github.com/go-acme/lego>
- <https://github.com/go-acme/lego/discussions/1914>
- <https://github.com/go-acme/lego/releases>
- <https://go-acme.github.io/lego/>
- <https://go-acme.github.io/lego/dns/>
- <https://www.rfc-editor.org/rfc/rfc8555>


## 安全说明

没有找到 lego 的匹配本地密钥处理 manifest。软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** lego
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - lego - 4.9.1-2: normalized package name match | Debian stable package indexes: lego from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Let's Encrypt client | https://github.com/go-acme/lego
- Nix - lego: normalized package name match | nixpkgs package indexes: pkgs/by-name/le/lego/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - lego - 4.9.1-2: normalized package name match | Ubuntu 24.04 LTS package indexes: lego from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Let's Encrypt client | https://github.com/go-acme/lego
- apk - lego - 4.35.2-r2: normalized package name match | Alpine Linux edge package indexes: lego from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Let's Encrypt client and ACME library written in Go | https://github.com/go-acme/lego
- apk - lego-doc - 4.35.2-r2: normalized package name match | Alpine Linux edge package indexes: lego-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Let's Encrypt client and ACME library written in Go (documentation) | https://github.com/go-acme/lego
- dnf - lego - 5.3.1-1.fc45: normalized package name match | Fedora Rawhide package metadata: lego from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Let's Encrypt/ACME client written in Go | https://github.com/go-acme/lego
- pacman - lego - 5.3.1-1: normalized package name match | Arch Linux sync databases: lego from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Lets Encrypt client and ACME library | https://go-acme.github.io/lego
- zypper - lego - 5.3.1-1.2: normalized package name match | openSUSE Tumbleweed package metadata: lego from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Let's Encrypt/ACME client and library written in Go | https://github.com/go-acme/lego
- MacPorts - lego: normalized package name match | MacPorts ports tree: security/lego/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/lego: normalized package name match | Scoop official bucket manifest trees: bucket/lego.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - GoACME.lego: normalized package name match | Windows Package Manager source index: GoACME.lego from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://pkg.so/zh-hans/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [certbot](https://pkg.so/zh-hans/brew/certbot/) - Shares pkgdb curated category or tags: acme, certificates, cli, letsencrypt, security.
- [showcert](https://pkg.so/zh-hans/brew/showcert/) - Shares pkgdb curated category or tags: certificates, cli, letsencrypt, security.
- [mkcert](https://pkg.so/zh-hans/brew/mkcert/) - Shares pkgdb curated category or tags: certificates, cli, security.
- [acme.sh](https://pkg.so/zh-hans/brew/acme-sh/) - Shares pkgdb curated category or tags: acme, certificates, cli, letsencrypt, security.
- [certigo](https://pkg.so/zh-hans/brew/certigo/) - Shares pkgdb curated category or tags: certificates, cli, security.
- [crip](https://pkg.so/zh-hans/brew/crip/) - Shares pkgdb curated category or tags: certificates, cli, security.
- [minica](https://pkg.so/zh-hans/brew/minica/) - Shares pkgdb curated category or tags: certificates, cli, security.
- [certstrap](https://pkg.so/zh-hans/brew/certstrap/) - Shares pkgdb curated category or tags: certificates, cli, security.
- [dnsrobocert](https://pkg.so/zh-hans/brew/dnsrobocert/) - Security-sensitive metadata or terminology overlaps. Shared terms: acme, certificates, cli, encrypt, let.

## Combined YAML source

View the package source record on GitHub. [combined/lego.yml](https://github.com/mxcl/pkgdb/blob/main/combined/lego.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
