# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper 安装 dtach

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

## 安装

```sh
sudo av install brew:dtach
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install dtach
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install dtach
```

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

### Linux

- apk (92%):

```sh
sudo apk add dtach
```

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

- Debian apt (92%):

```sh
sudo apt install dtach
```

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

- dnf (92%):

```sh
sudo dnf install dtach
```

  证据: Fedora Rawhide package metadata: dtach 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#dtach
```

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

- zypper (92%):

```sh
sudo zypper install dtach
```

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

## 软件包事实

- **软件包键:** brew:dtach
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/dtach>
- **版本:** 0.9
- **来源摘要:** Emulates the detach feature of screen
- **主页:** <https://dtach.sourceforge.net/>
- **上游文档:** <https://dtach.sourceforge.net/>
- **许可证:** GPL-2.0-or-later
- **源码归档:** <https://downloads.sourceforge.net/project/dtach/dtach/0.9/dtach-0.9.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- dtach (cli)
- dtach (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.9
- 本地数据: OK
- 上游仓库: https://dtach.sourceforge.net/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

dtach is a tiny C program that provides the detach-and-reattach part of GNU screen without screen's terminal emulator, window management, or broader feature set. It is a classic Unix package for people who want one behavior, a Unix-domain socket, and almost nothing else.

### 项目历史

dtach was written by Ned T. Crigler because screen did not fit his needs: he wanted detached terminal sessions without multiple terminal support, terminal emulation, stream interpretation, or a large codebase. The official README says dtach passes the raw output stream through and only processes the detach character and suspend key unless those features are disabled.

The project's official changelog records an initial SourceForge release in version 0.3, portability work in 0.4 for FreeBSD, Debian alpha, Debian SPARC, Debian PowerPC, and Solaris, redraw and process-group changes in later releases, and version 0.9 adding AIX support plus `dtach -N` and `dtach -p` modes.

The SourceForge homepage points to the GitHub repository for development, making the GitHub URL the official HTTP(S) source-control page while SourceForge remains the canonical homepage and release-download surface.

### 采用历史

dtach became a quiet packaging staple because it solves a durable Unix problem with a tiny dependency footprint. The input package metadata records packages across Homebrew, Debian, Ubuntu, Fedora/DNF, Alpine/apk, MacPorts, Nix, and zypper ecosystems, and Homebrew still packages the 0.9 SourceForge tarball.

Its adoption is not about a fast-moving upstream. It is about stability: terminal users, rescue environments, remote shells, and minimal systems can get detach semantics without installing the heavier screen or tmux experience.

### 使用方式

Users create or attach to sessions by naming a Unix-domain socket, for example with `dtach -A /tmp/session command`, then detach with the configured detach key and later reattach. Separate attachers can choose different detach characters, suspend handling, and redraw methods.

dtach does not preserve scrollback or screen contents, so it works best with programs that can redraw themselves. The official page calls out full-screen programs such as emacs and ircII as motivating use cases because dtach avoids screen's terminal interpretation layer.

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

dtach is significant because it is the purest version of a beloved package-manager category: carve one feature out of a larger tool, keep the code tiny, and let users compose it with the rest of Unix. It is the detach feature as a package.

It also remains a useful contrast point for screen, tmux, abduco, dvtm, and terminal multiplexers generally. Package nerds care because dtach marks the boundary between session persistence and full terminal multiplexing.

### 时间线

- 2004: The README copyright line begins, matching the early dtach era.
- Version 0.3: The official changelog records the initial SourceForge release.
- Version 0.4: Portability work adds FreeBSD, Debian alpha, Debian SPARC, Debian PowerPC, and Solaris support.
- Version 0.9: The release adds AIX support, `dtach -N`, `dtach -p`, signal-state preservation, and socket-path fixes.
- 2016: The README copyright line extends through 2016.
- 2026: Homebrew still packages dtach 0.9 from SourceForge.

### Related projects

- GNU screen is the direct comparison and source of the detach feature dtach emulates.
- tmux is the modern terminal multiplexer users often compare with dtach, though dtach intentionally avoids multiplexing features.
- abduco and dvtm occupy nearby minimalist terminal-session territory.

### 来源

- <https://dtach.sourceforge.net/>
- <https://github.com/crigler/dtach>
- <https://raw.githubusercontent.com/crigler/dtach/master/README>
- <https://formulae.brew.sh/api/formula/dtach.json>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

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

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

- Debian apt - dtach - 0.9-7: normalized package name match | Debian stable package indexes: dtach from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | emulates the detach/attach feature of screen | http://dtach.sourceforge.net/
- Nix - dtach: normalized package name match | nixpkgs package indexes: pkgs/by-name/dt/dtach/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - dtach - 0.9-5build1: normalized package name match | Ubuntu 24.04 LTS package indexes: dtach from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | emulates the detach/attach feature of screen | http://dtach.sourceforge.net/
- apk - dtach - 0.9-r7: normalized package name match | Alpine Linux edge package indexes: dtach from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A program that emulates the detach feature of screen | https://dtach.sourceforge.net/
- apk - dtach-doc - 0.9-r7: normalized package name match | Alpine Linux edge package indexes: dtach-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A program that emulates the detach feature of screen (documentation) | https://dtach.sourceforge.net/
- dnf - dtach - 0.9-33.fc45: normalized package name match | Fedora Rawhide package metadata: dtach from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | A simple program that emulates the detach feature of screen | http://dtach.sourceforge.net
- zypper - dtach - 0.9+2.748020b-3.5: normalized package name match | openSUSE Tumbleweed package metadata: dtach from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Background processes and reattach to them | http://dtach.sourceforge.net/
- MacPorts - dtach: normalized package name match | MacPorts ports tree: sysutils/dtach/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://pkg.so/zh-hans/brew-utility-packages/) - Matched Homebrew package provider.
- [screen](https://pkg.so/zh-hans/brew/screen/) - Shares pkgdb curated category or tags: cli, session-management, system, terminal.
- [pv](https://pkg.so/zh-hans/brew/pv/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [less](https://pkg.so/zh-hans/brew/less/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [ranger](https://pkg.so/zh-hans/brew/ranger/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [lesspipe](https://pkg.so/zh-hans/brew/lesspipe/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [picocom](https://pkg.so/zh-hans/brew/picocom/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [ov](https://pkg.so/zh-hans/brew/ov/) - Shares pkgdb curated category or tags: cli, system, terminal.
- [abduco](https://pkg.so/zh-hans/brew/abduco/) - Shares pkgdb curated category or tags: cli, detach, session-management, system, terminal.

## Combined YAML source

View the package source record on GitHub. [combined/dtach.yml](https://github.com/mxcl/pkgdb/blob/main/combined/dtach.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
