# 使用 Homebrew, apk, apt, dnf, MacPorts, pacman 安装 thefuck

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

## 安装

```sh
sudo av install brew:thefuck
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install thefuck
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install thefuck
```

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

### Linux

- apk (92%):

```sh
sudo apk add thefuck
```

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

- Debian apt (92%):

```sh
sudo apt install thefuck
```

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

- dnf (92%):

```sh
sudo dnf install thefuck
```

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

- pacman (92%):

```sh
sudo pacman -S thefuck
```

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

## 软件包事实

- **软件包键:** brew:thefuck
- **软件包管理器:** Homebrew
- **版本:** 3.32
- **来源摘要:** Programmatically correct mistyped console commands
- **主页:** <https://github.com/nvbn/thefuck>
- **仓库:** <https://github.com/nvbn/thefuck>
- **最后更新:** 2026-07-14T17:14:18+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- fuck (别名)
- thefuck (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

The Fuck is a Python command-line utility for correcting a previously failed shell command. Its official README presents it as an app inspired by a tweet and built around the `fuck` alias, which lets a user rerun a corrected version of the last command after errors such as missing `sudo`, misspelled Git subcommands, command-not-found typos, or bad package-manager invocations.

### 项目历史

The project grew around a rules engine: the README says it matches the previous command against enabled rules, creates a replacement command, and executes it after confirmation. The rule list spans common developer and system tools, including package managers, Git, Docker, language toolchains, shells, and file utilities, making the project less a spelling corrector than a catalog of everyday terminal failure modes.

### 采用历史

The Fuck became unusually visible for a shell helper: the official GitHub page shows tens of thousands of stars and thousands of forks, while the assigned package facts list packages across Homebrew, Debian, Ubuntu, Fedora, Arch, Alpine, MacPorts, and other ecosystems. Its README also documents installation through Homebrew, FreeBSD packages, Chromebrew, Arch packages, and pip, which reflects the tool's spread through both language and OS package-manager culture.

### 使用方式

The normal workflow is to install the package, add `eval $(thefuck --alias)` to a shell startup file, run a command that fails, and then type the alias to accept or select a corrected command. The README also documents options such as running without confirmation, recursively retrying fixes, customizing rules in `settings.py`, and using environment variables to tune behavior.

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

For package nerds, The Fuck is interesting because many of its examples and built-in rules encode package-manager ergonomics: it can add `sudo` for `apt-get`, correct Chocolatey package suffixes, fix Homebrew- and system-tool-adjacent command mistakes, and turn common install-time errors into repeatable command rewrites. It is also a good example of a package whose memorable command name helped it become a cross-distro terminal utility.

### 时间线

- 2017: GitHub tags page shows the 3.23 release.
- 2018: GitHub tags page shows multiple 3.x releases, including 3.26 through 3.28.
- 2022: GitHub tags page shows release 3.32.
- Current README: documents package-manager installation, shell alias setup, rule-based correction, settings.py, and environment-variable configuration.

### Related projects

- Related tools in the same terminal-productivity niche include shell history search, command-not-found helpers, package-manager suggestion tools, and shell frameworks that add aliases or completions. The Fuck differs by taking the previous failed command and proposing a runnable replacement.

### 来源

- <https://github.com/nvbn/thefuck#readme - official README for description, examples, installation methods, alias setup, rule engine, settings.py, and environment variables.>
- <https://github.com/nvbn/thefuck/tags - official GitHub tags page for release timeline.>
- input source_facts.package-manager - assigned package facts list cross-ecosystem package-manager availability.


## 安全说明

narrow executable package without higher-risk signals.

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


## 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: ~/.config/thefuck/settings.py
## 其他软件包管理器记录

- Debian apt - thefuck - 3.32-0.3: normalized package name match | Debian stable package indexes: thefuck from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | spelling corrector of console commands | https://github.com/nvbn/thefuck
- Ubuntu apt - thefuck - 3.29-0.3ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: thefuck from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | spelling corrector of console commands | https://github.com/nvbn/thefuck
- apk - thefuck - 3.32-r6: normalized package name match | Alpine Linux edge package indexes: thefuck from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | The Fuck is a magnificent app that corrects errors in previous console commands. | https://github.com/nvbn/thefuck
- apk - thefuck-pyc - 3.32-r6: normalized package name match | Alpine Linux edge package indexes: thefuck-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for thefuck | https://github.com/nvbn/thefuck
- dnf - thefuck - 3.32-20.fc44: normalized package name match | Fedora Rawhide package metadata: thefuck from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | App that corrects your previous console command | https://github.com/nvbn/thefuck
- pacman - thefuck - 3.32-13: normalized package name match | Arch Linux sync databases: thefuck from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Magnificent app which corrects your previous console command | https://github.com/nvbn/thefuck
- MacPorts - thefuck: normalized package name match | MacPorts ports tree: python/thefuck/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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