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

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

## 安装

```sh
sudo av install brew:emacs
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install emacs
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install emacs
```

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

### Linux

- apk (92%):

```sh
sudo apk add emacs
```

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

- Debian apt (92%):

```sh
sudo apt install emacs
```

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

- dnf (92%):

```sh
sudo dnf install emacs
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#emacs
```

  证据: nixpkgs package indexes: emacs from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S emacs
```

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

- zypper (92%):

```sh
sudo zypper install emacs
```

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

### Windows

- Chocolatey (92%):

```sh
choco install Emacs
```

  证据: Chocolatey community package catalog: Emacs from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','edrawings-viewer'

- Scoop (92%):

```sh
scoop install extras/emacs
```

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

- winget (92%):

```sh
winget install --id GNU.Emacs -e
```

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

## 软件包事实

- **软件包键:** brew:emacs
- **软件包管理器:** Homebrew
- **版本:** 30.2
- **来源摘要:** GNU Emacs text editor
- **主页:** <https://www.gnu.org/software/emacs/>
- **仓库:** <https://github.com/emacs-mirror/emacs>
- **最后更新:** 2026-06-22T14:03:14-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ebrowse (别名)
- emacs (别名)
- emacs-30.2 (别名)
- emacsclient (别名)
- etags (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 30.2
## 项目历史与用法

GNU Emacs is the GNU project's extensible, customizable text editor and Lisp environment. It is both a daily editor and a programmable application platform, shipped by essentially every Unix-like package manager and widely used through terminal, GUI, daemon, and emacsclient workflows.

### 项目历史

The Emacs lineage began before GNU: the GNU source tree's HISTORY file says EMACS started as macros on top of the TECO editor and was first operational in late 1976. That original idea, an extensible and self-documenting editor, became one of the defining models for programmable development environments.

Work on GNU Emacs began in 1984 as a fresh implementation for GNU and GNU-like systems with a full-featured Lisp at its core. GNU Emacs 13, the initial public release, was announced on Usenet on 1985-03-20, and the project has kept a long stable-release history in the source tree since then.

Over later decades, GNU Emacs accumulated major editing, programming, package, display, and platform features while keeping Emacs Lisp as the extension language. The NEWS files remain the canonical record of user-visible changes, with Emacs 30 adding items such as default native compilation where libgccjit is available, Android port work, and always-available native JSON support.

### 采用历史

Emacs spread through Unix and free software culture because it was not only an editor but a programmable environment. Its extension model made modes, mail/news clients, shells, version-control interfaces, language tooling, and personal workflows installable or scriptable inside one long-lived process.

Package-manager adoption is unusually broad: GNU Emacs is available through Homebrew, Debian, Ubuntu, Fedora, Arch, Nix, MacPorts, Chocolatey, Scoop, winget, and other systems. That breadth reflects both its age and its continuing role as a baseline developer and writing tool across operating systems.

Modern adoption also depends on package archives and init-file culture. Users typically maintain an init.el or equivalent startup file, install packages, and share configuration snippets; package managers provide the editor binary, while Emacs's own package system and Lisp ecosystem provide much of the user experience.

### 使用方式

GNU Emacs is commonly launched as emacs for an interactive session, emacsclient for connecting to a server, or as a terminal/GUI editor depending on the build. Users customize startup through files such as ~/.emacs, ~/.emacs.d/init.el, or XDG-style ~/.config/emacs/init.el, with early-init.el available for earlier startup customization.

Common use spans text editing, programming, project navigation, shells, version control, mail, notes, and literate configuration. Its significance is not one workflow but the fact that many workflows can be implemented in Emacs Lisp and loaded into the same editor.

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

GNU Emacs is package-nerd bedrock: it is a large, old, highly configurable package with compile-time options, GUI toolkit choices, native compilation, daemon/client modes, and many downstream variants. Installing Emacs is often the start of another package ecosystem managed through Emacs Lisp packages and user configuration.

For maintainers, Emacs is also a portability test case. It spans terminal and graphical builds, Unix-like systems and Windows, optional libraries, and decades of compatibility expectations. That makes it a recurring package-manager benchmark for patches, bottles, build flags, and upgrade migrations.

### 时间线

- 1976: EMACS becomes operational as TECO macros.
- 1984: Work begins on GNU Emacs as a new implementation for GNU and GNU-like systems.
- 1985: GNU Emacs 13 is announced as the initial public release.
- 1997: GNU Emacs 20.1 is released.
- 2001: GNU Emacs 21.1 is released.
- 2012: GNU Emacs 24.1 is released.
- 2018: GNU Emacs 26.1 is released.
- 2025: Emacs 30 NEWS records Emacs 30.2 as a bug-fix release and Emacs 30.1 user-visible changes.

### Related projects

- GNU Emacs is related to earlier TECO-based Emacs systems, XEmacs, Emacs Lisp package archives, and editor ecosystems such as Vim and modern IDEs. In package-manager data it is also connected to helper executables such as emacsclient, etags, and ebrowse.

### 来源

- <https://git.savannah.gnu.org/cgit/emacs.git/plain/etc/HISTORY?h=emacs-30>
- <https://git.savannah.gnu.org/cgit/emacs.git/plain/etc/NEWS?h=emacs-30>
- <https://www.gnu.org/software/emacs/>
- <https://www.gnu.org/software/emacs/documentation.html>
- <https://www.gnu.org/software/emacs/manual>


## 安全说明

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- broad file, network, media, or database tool signal
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.emacs.el, ~/.emacs, ~/.emacs.d/init.el, ~/.config/emacs/init.el, ~/.emacs.d/early-init.el, ~/.config/emacs/early-init.el
## 其他软件包管理器记录

- Debian apt - emacs - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor (metapackage) | https://www.gnu.org/software/emacs/
- Debian apt - emacs-bin-common - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-bin-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor's shared, architecture dependent files | https://www.gnu.org/software/emacs/
- Debian apt - emacs-common - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor's shared, architecture independent infrastructure | https://www.gnu.org/software/emacs/
- Debian apt - emacs-el - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-el from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs LISP (.el) files | https://www.gnu.org/software/emacs/
- Debian apt - emacs-gtk - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-gtk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor (with GTK+ GUI support) | https://www.gnu.org/software/emacs/
- Debian apt - emacs-lucid - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-lucid from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor (with Lucid GUI support) | https://www.gnu.org/software/emacs/
- Debian apt - emacs-nox - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-nox from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor (without GUI support) | https://www.gnu.org/software/emacs/
- Debian apt - emacs-pgtk - 1:30.1+1-6: normalized package name match | Debian stable package indexes: emacs-pgtk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Emacs editor (with GTK+ Wayland GUI support) | https://www.gnu.org/software/emacs/
- Nix - emacs: normalized package name match | nixpkgs package indexes: emacs from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - emacs - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor (metapackage) | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-bin-common - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-bin-common from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor's shared, architecture dependent files | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-common - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-common from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor's shared, architecture independent infrastructure | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-el - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-el from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs LISP (.el) files | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-gtk - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-gtk from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor (with GTK+ GUI support) | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-lucid - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-lucid from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor (with Lucid GUI support) | https://www.gnu.org/software/emacs/
- Ubuntu apt - emacs-nox - 1:29.3+1-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: emacs-nox from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Emacs editor (without GUI support) | https://www.gnu.org/software/emacs/


## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
