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

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

## 安装

```sh
sudo av install brew:fakeroot
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install fakeroot
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install fakeroot
```

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

### Linux

- apk (92%):

```sh
sudo apk add fakeroot
```

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

- Debian apt (92%):

```sh
sudo apt install fakeroot
```

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

- dnf (92%):

```sh
sudo dnf install fakeroot
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#fakeroot
```

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

- pacman (92%):

```sh
sudo pacman -S fakeroot
```

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

- zypper (92%):

```sh
sudo zypper install fakeroot
```

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

## 软件包事实

- **软件包键:** brew:fakeroot
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/fakeroot>
- **版本:** 1.38.1
- **来源摘要:** Provide a fake root environment
- **主页:** <https://tracker.debian.org/pkg/fakeroot>
- **仓库:** <https://salsa.debian.org/clint/fakeroot>
- **上游文档:** <https://manpages.debian.org/fakeroot>
- **许可证:** GPL-3.0-or-later
- **源码归档:** <https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.38.1.orig.tar.gz>
- **最后更新:** 2026-05-21T04:00:18Z
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- faked (cli)
- fakeroot (cli)
- faked (别名)
- fakeroot (别名)

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 1.38.1
- 管理器更新时间: 2026-05-21
- 本地数据: OK
- 上游仓库: https://tracker.debian.org/pkg/fakeroot
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

fakeroot runs a command in an environment where file manipulation appears to happen with root privileges, without granting real root access. It is a core packaging utility because archives can be built with root-looking ownership, permissions, and device metadata by unprivileged users.

### 项目历史

fakeroot entered Debian in June 1997 as a tool by Joost Witteveen. Early changelog entries show it rapidly gaining wrappers for chown, chmod, stat, mkdir, rename, and related calls, plus IPC handling and tests needed to make dpkg-buildpackage -rfakeroot reliable.

The manpage explains the central implementation: fakeroot replaces selected file-manipulation library functions with wrappers loaded through LD_PRELOAD, while the faked daemon preserves the fake ownership and permission view. The design intentionally avoids wrapping some calls such as open() because too many libc interactions would create fragile loops and portability problems.

Over time fakeroot became maintained as a Debian project package, with authors and contributors including Joost Witteveen, Clint Adams, Timo Savola, Regis Duchesne, Mikhail Gusarov, J.H.M. Dassen for the manual page, and Kyle J. McKay for OS X support. The current Salsa repository tracks ongoing fixes for libc, architecture, translation, xattr, time64, and cross-build behavior.

### 采用历史

fakeroot was specifically written to enable users to create Debian packages without root privileges. The manpage documents dpkg-buildpackage -rfakeroot and debuild -rfakeroot as normal workflows, and notes that debuild defaults to fakeroot in modern usage.

Its adoption spread beyond Debian because the problem is generic to Unix packaging: package builds often need archive metadata to say root:root even though the build user should not be root. The package-manager list in the input shows fakeroot packaged across APK, Homebrew, Debian, Fedora/DNF, MacPorts, Nix, Arch/pacman, Ubuntu, and openSUSE/zypper ecosystems.

### 使用方式

Typical use wraps only the packaging or archive-creation phase, not the configure or binary build phase. The manpage warns that configure-style probes can get confused when fakeroot changes apparent system behavior, and recommends letting Debian build targets call fakeroot at the correct stage.

fakeroot is also useful for tar, ar, .deb, backup, and restore workflows that need root-looking ownership or device information in an archive. Its -s and -i options can save and reload a fakeroot environment, with documented caveats about touching files outside the saved fake view.

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

fakeroot matters because it helped make unprivileged package builds routine. Before tools like fakeroot, a packager either needed real root privileges to create files with root ownership before archiving, or had to construct archive metadata directly.

It is also an instructive Unix packaging artifact: small, sharp, LD_PRELOAD-based, explicitly non-setuid, and honest about its limitations. Distribution maintainers care about it because subtle libc, stat, xattr, and architecture changes can affect whether huge portions of a packaging ecosystem build reproducibly without privilege.

### 时间线

- 1997-06: Initial Debian changelog entry for fakeroot 0.0-0.
- 1997-07: Changelog states dpkg-buildpackage -rfakeroot works reliably and the package was built as non-root.
- 1997-08: A manpage and additional wrappers/tests are added.
- 2014: Debian manpage revision documents the modern fakeroot command behavior.
- 2018: The Debian Salsa repository is created.
- 2026: fakeroot 1.38.1-1 is uploaded to Debian unstable with xattr and unknown-file handling fixes.

### Related projects

- fakeroot is tightly connected to faked, dpkg-buildpackage, debuild, deb archives, and Debian packaging policy. The manpage also contrasts its intentionally limited wrappers with libtricks-style broader interception.

### 来源

- <https://manpages.debian.org/bookworm/fakeroot/fakeroot.1.en>
- <https://salsa.debian.org/clint/fakeroot>
- <https://salsa.debian.org/api/v4/projects/clint%2Ffakeroot>
- <https://salsa.debian.org/api/v4/projects/clint%2Ffakeroot/repository/files/README/raw?ref=main>
- <https://salsa.debian.org/api/v4/projects/clint%2Ffakeroot/repository/files/AUTHORS/raw?ref=main>
- <https://tracker.debian.org/media/packages/f/fakeroot/changelog-1.38.1-1>


## 安全说明

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


## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** fakeroot
- **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 - fakeroot - 1.37.1.1-1: normalized package name match | Debian stable package indexes: fakeroot from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for simulating superuser privileges
- Debian apt - libfakeroot - 1.37.1.1-1: normalized package name match | Debian stable package indexes: libfakeroot from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for simulating superuser privileges - shared libraries
- Nix - fakeroot: normalized package name match | nixpkgs package indexes: pkgs/by-name/fa/fakeroot/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - fakeroot - 1.33-1: normalized package name match | Ubuntu 24.04 LTS package indexes: fakeroot from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | tool for simulating superuser privileges
- Ubuntu apt - libfakeroot - 1.33-1: normalized package name match | Ubuntu 24.04 LTS package indexes: libfakeroot from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | tool for simulating superuser privileges - shared libraries
- apk - fakeroot - 1.37.2-r0: normalized package name match | Alpine Linux edge package indexes: fakeroot from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Gives a fake root environment, useful for building packages as a non-privileged user | https://packages.debian.org/fakeroot
- apk - fakeroot-dbg - 1.37.2-r0: normalized package name match | Alpine Linux edge package indexes: fakeroot-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Gives a fake root environment, useful for building packages as a non-privileged user (debug symbols) | https://packages.debian.org/fakeroot
- apk - fakeroot-doc - 1.37.2-r0: normalized package name match | Alpine Linux edge package indexes: fakeroot-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Gives a fake root environment, useful for building packages as a non-privileged user (documentation) | https://packages.debian.org/fakeroot
- dnf - fakeroot - 1.37.1-4.fc44: normalized package name match | Fedora Rawhide package metadata: fakeroot from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Gives a fake root environment | https://tracker.debian.org/pkg/fakeroot
- dnf - fakeroot-libs - 1.37.1-4.fc44: normalized package name match | Fedora Rawhide package metadata: fakeroot-libs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Gives a fake root environment (libraries) | https://tracker.debian.org/pkg/fakeroot
- pacman - fakeroot - 1:1.37.2-1: normalized package name match | Arch Linux sync databases: fakeroot from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | Tool for simulating superuser privileges | https://tracker.debian.org/pkg/fakeroot
- zypper - fakeroot - 1.38-1.1: normalized package name match | openSUSE Tumbleweed package metadata: fakeroot from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Wrapper that gives a fake root environment | https://tracker.debian.org/pkg/fakeroot
- MacPorts - fakeroot: normalized package name match | MacPorts ports tree: sysutils/fakeroot/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Package publisher tools](https://www.automicvault.com/zh-hans/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/zh-hans/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Scientific computing packages](https://www.automicvault.com/zh-hans/pkg/scientific-computing-tools/) - Matched scientific computing metadata.
- [makepkg](https://www.automicvault.com/zh-hans/pkg/brew/makepkg/) - Popular package that depends on this formula.
- [acl](https://www.automicvault.com/zh-hans/pkg/brew/acl/) - Shares av.db curated category or tags: cli, filesystem, system.
- [afuse](https://www.automicvault.com/zh-hans/pkg/brew/afuse/) - Shares av.db curated category or tags: cli, filesystem, system.
- [agedu](https://www.automicvault.com/zh-hans/pkg/brew/agedu/) - Shares av.db curated category or tags: cli, filesystem, system.
- [archivemount](https://www.automicvault.com/zh-hans/pkg/brew/archivemount/) - Shares av.db curated category or tags: cli, filesystem, system.
- [attr](https://www.automicvault.com/zh-hans/pkg/brew/attr/) - Shares av.db curated category or tags: cli, filesystem, system.
- [avfs](https://www.automicvault.com/zh-hans/pkg/brew/avfs/) - Shares av.db curated category or tags: cli, filesystem, system.
- [bfs](https://www.automicvault.com/zh-hans/pkg/brew/bfs/) - Shares av.db curated category or tags: cli, filesystem, system.
- [bindfs](https://www.automicvault.com/zh-hans/pkg/brew/bindfs/) - Shares av.db curated category or tags: cli, filesystem, system.
- [debianutils](https://www.automicvault.com/zh-hans/pkg/brew/debianutils/) - Local package facts share a topical domain. Shared terms: cli, system.
- [apt](https://www.automicvault.com/zh-hans/pkg/brew/apt/) - Local package facts share a topical domain. Shared terms: cli, system.
- [mdf2iso](https://www.automicvault.com/zh-hans/pkg/brew/mdf2iso/) - Local package facts share a topical domain. Shared terms: cli, system.

## Combined YAML source

View the package source record on GitHub. [combined/fakeroot.yml](https://github.com/automic-vault/db/blob/main/combined/fakeroot.yml)


## 来源

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