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

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

## 安装

```sh
sudo av install brew:dos2unix
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install dos2unix
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install dos2unix
```

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

### Linux

- apk (92%):

```sh
sudo apk add dos2unix
```

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

- Debian apt (92%):

```sh
sudo apt install dos2unix
```

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

- dnf (92%):

```sh
sudo dnf install dos2unix
```

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

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

- pacman (92%):

```sh
sudo pacman -S dos2unix
```

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

- zypper (92%):

```sh
sudo zypper install dos2unix
```

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

### Windows

- Chocolatey (92%):

```sh
choco install dos2unix
```

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

- Scoop (92%):

```sh
scoop install main/dos2unix
```

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

- winget (92%):

```sh
winget install --id waterlan.dos2unix -e
```

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

## 软件包事实

- **软件包键:** brew:dos2unix
- **软件包管理器:** Homebrew
- **版本:** 7.5.6
- **来源摘要:** Convert text between DOS, UNIX, and Mac formats
- **主页:** <https://waterlander.net/dos2unix/>
- **最后更新:** 2026-06-27T04:30:36Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- dos2unix (别名)
- mac2unix (别名)
- unix2dos (别名)
- unix2mac (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

dos2unix is the long-running command-line utility family for converting plain-text line endings among DOS/Windows CRLF, Unix LF, and classic Mac CR formats. Its package-nerd appeal is that it solves one of the oldest cross-platform source-tree annoyances with tiny, scriptable tools that became familiar on Unix, Linux, Windows, DOS, Cygwin, and OS/2.

### 项目历史

The current dos2unix package is an Erwin Waterlander-maintained update of Benjamin Lin's dos2unix and unix2dos implementations. The official history traces the lineage back to John Birchfield's 1989 versions, Benjamin Lin's 1995 rewrite, Bernd Johannes Wuebben's 1998 Mac-to-Unix addition, and Waterlander's 2010 Unix-to-Mac addition.

The Waterlander package bundled the formerly separate dos2unix and unix2dos packages into a single dos2unix release at version 5.0 in 2010. Later milestones included UTF-16 support in version 6.0 in 2012 and a major cleanup plus test suite in version 7.0 in 2014.

### 采用历史

Benjamin Lin's implementations were distributed through SunSITE.unc.edu, later MetaLab and ibiblio, and became part of Linux distributions including Red Hat, SUSE, Gentoo, and others. The Homebrew source facts also list broad packaging across apk, Debian, Fedora, MacPorts, Nix, pacman, Scoop, Ubuntu, winget, and zypper.

The official homepage continues to publish source archives and ready-to-run binaries for DOS, Windows, and OS/2 alongside Unix-style documentation, reflecting a tool whose user base spans old and modern operating systems.

### 使用方式

The package includes dos2unix, unix2dos, mac2unix, and unix2mac commands. It is commonly used in source checkouts, release scripts, build systems, and data-cleanup pipelines when files cross Windows and Unix-like environments.

Modern dos2unix does more than swap CRLF and LF: official documentation covers in-place and paired conversion modes, binary-file skipping, symbolic-link behavior, Unicode UTF-16 to UTF-8 conversion, byte-order-mark handling, recursive conversion recipes, and translated manuals.

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

dos2unix is a classic small package that persists because text line endings remain a real interoperability boundary. Package maintainers care about it because it is tiny, has no credential or daemon surface, and shows up wherever archives, generated files, or vendored code cross platform conventions.

Its significance is also historical: it preserves SunOS/Solaris-style behavior while adjusting defaults for practical Unix packaging, such as in-place conversion by default in this implementation.

### 时间线

- 1989: John Birchfield creates early dos2unix/unix2dos versions modeled after SunOS/Solaris tools.
- 1995: Benjamin Lin rewrites the implementations from scratch.
- 1998: Mac-to-Unix conversion is added by Bernd Johannes Wuebben.
- 2010: Erwin Waterlander adds Unix-to-Mac conversion and bundles dos2unix and unix2dos into one package as version 5.0.
- 2012: Version 6.0 adds Unicode UTF-16 support.
- 2014: Version 7.0 performs a major cleanup and adds a test suite.
- 2026: Version 7.5.6 is published with the new waterlander.net homepage and updated manual translations.

### Related projects

- The package is related to the historical SunOS/Solaris dos2unix utilities it was modeled after, to Benjamin Lin's earlier public implementations, and to the paired unix2dos/mac2unix/unix2mac commands shipped in the same package.

### 来源

- <https://waterlander.net/dos2unix>
- <https://dos2unix.sourceforge.io/dos2unix/man1/dos2unix.htm>
- <https://formulae.brew.sh/formula/dos2unix>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - dos2unix - 7.5.2-1: normalized package name match | Debian stable package indexes: dos2unix from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | convert text file line endings between CRLF and LF | https://waterlan.home.xs4all.nl/dos2unix.html
- Nix - dos2unix: normalized package name match | nixpkgs package indexes: pkgs/by-name/do/dos2unix/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - dos2unix - 7.5.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: dos2unix from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | convert text file line endings between CRLF and LF | https://waterlan.home.xs4all.nl/dos2unix.html
- apk - dos2unix - 7.5.6-r0: normalized package name match | Alpine Linux edge package indexes: dos2unix from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Text file format converters | https://waterlander.net/dos2unix/
- apk - dos2unix-doc - 7.5.6-r0: normalized package name match | Alpine Linux edge package indexes: dos2unix-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Text file format converters (documentation) | https://waterlander.net/dos2unix/
- dnf - dos2unix - 7.5.5-2.fc45: normalized package name match | Fedora Rawhide package metadata: dos2unix from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Text file format converters | https://waterlan.home.xs4all.nl/dos2unix.html
- pacman - dos2unix - 7.5.6-1: normalized package name match | Arch Linux sync databases: dos2unix from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Text file format converter | https://waterlan.home.xs4all.nl/dos2unix.html
- zypper - dos2unix - 7.5.6-1.3: normalized package name match | openSUSE Tumbleweed package metadata: dos2unix from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Text converters to and from DOS/MAC to UNIX | https://waterlander.net/dos2unix/
- MacPorts - dos2unix: normalized package name match | MacPorts ports tree: textproc/dos2unix/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - dos2unix: normalized package name match | Chocolatey community package catalog: dos2unix from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','dispcalgui.install'
- Scoop - main/dos2unix: normalized package name match | Scoop official bucket manifest trees: bucket/dos2unix.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - waterlan.dos2unix: normalized package name match | Windows Package Manager source index: waterlan.dos2unix from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

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


## 来源

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