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

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

## 安装

```sh
sudo av install brew:ccache
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ccache
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ccache
```

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

### Linux

- apk (92%):

```sh
sudo apk add ccache
```

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

- Debian apt (92%):

```sh
sudo apt install ccache
```

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

- dnf (92%):

```sh
sudo dnf install ccache
```

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

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

- pacman (92%):

```sh
sudo pacman -S ccache
```

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

- zypper (92%):

```sh
sudo zypper install ccache
```

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

### Windows

- Chocolatey (92%):

```sh
choco install ccache
```

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

- Scoop (92%):

```sh
scoop install main/ccache
```

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

- winget (92%):

```sh
winget install --id Ccache.Ccache -e
```

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

## 软件包事实

- **软件包键:** brew:ccache
- **软件包管理器:** Homebrew
- **版本:** 4.13.6
- **来源摘要:** Object-file caching compiler wrapper
- **主页:** <https://ccache.dev/>
- **仓库:** <https://github.com/ccache/ccache>
- **最后更新:** 2026-08-02T01:55:34+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ccache (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Ccache is a compiler cache that speeds up recompilation by caching prior compilations and detecting when the same compilation is being done again.

### 项目历史

The official credits page says ccache was originally written by Andrew Tridgell, inspired by Erik Thiele's compilercache shell script, and has been developed and maintained by Joel Rosdahl since 2010.

### 采用历史

The official site presents ccache as a cross-platform build accelerator supporting GCC, Clang, MSVC, and similar compilers on Linux, Windows, macOS, and other Unix-like systems. The supplied package facts show broad package-manager availability, including Homebrew, Debian, Fedora, Nix, MacPorts, Chocolatey, Scoop, winget, Alpine, Arch, Ubuntu, and zypper.

### 使用方式

Ccache is used by developers and build farms to speed repeated clean builds, branch builds, and shared compilation servers. The manual documents command modes, statistics, automatic cleanup, local and remote storage, cache-specific and directory-specific configuration files, environment variables, and direct/depend modes.

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

Few developer packages are as visibly package-manager-adjacent as ccache: it is commonly installed globally, inserted ahead of compilers in PATH or build-system variables, and tuned through predictable config files and environment variables. It is also a useful packaging stress test because it wraps many compilers while trying to preserve exact compiler output.

### 时间线

- 2010: Official credits identify Joel Rosdahl as maintainer from this year.
- 2016-06-06: Official news says source code and bug tracking moved to GitHub.
- 2019-04-03: Official news says the website moved to ccache.dev.
- 2026-05-04: Official news lists ccache 4.13.6 as released.

### Related projects

- Erik Thiele's compilercache, GCC, Clang, MSVC, distcc-style compiler-wrapper workflows, and remote cache/storage helpers.

### 来源

- <https://api.github.com/repos/ccache/ccache>
- <https://github.com/ccache/ccache>
- <https://ccache.dev/>
- <https://ccache.dev/documentation.html>
- <https://ccache.dev/manual/4.13.6.html>
- <https://formulae.brew.sh/api/formula/ccache.json>


## 安全说明

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

- Linux: $CCACHE_CONFIGPATH, $CCACHE_DIR/ccache.conf, <cache_dir>/ccache.conf, ~/.ccache/ccache.conf, $XDG_CONFIG_HOME/ccache/ccache.conf, ~/.config/ccache/ccache.conf
- macOS: $CCACHE_CONFIGPATH, $CCACHE_DIR/ccache.conf, <cache_dir>/ccache.conf, ~/.ccache/ccache.conf, $XDG_CONFIG_HOME/ccache/ccache.conf, ~/Library/Preferences/ccache/ccache.conf
- Windows: %CCACHE_CONFIGPATH%, %CCACHE_DIR%/ccache.conf, <cache_dir>\ccache.conf, %USERPROFILE%\.ccache\ccache.conf, %LOCALAPPDATA%\ccache\ccache.conf, %APPDATA%\ccache\ccache.conf
## 其他软件包管理器记录

- Debian apt - ccache - 4.11.2-2: normalized package name match | Debian stable package indexes: ccache from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Compiler cache for fast recompilation of C/C++ code | https://ccache.dev
- Nix - ccache: normalized package name match | nixpkgs package indexes: pkgs/by-name/cc/ccache/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - ccache - 4.9.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: ccache from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Compiler cache for fast recompilation of C/C++ code | https://ccache.dev
- apk - ccache - 4.13.6-r0: normalized package name match | Alpine Linux edge package indexes: ccache from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | fast C/C++ compiler cache | https://ccache.dev/
- apk - ccache-doc - 4.13.6-r0: normalized package name match | Alpine Linux edge package indexes: ccache-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | fast C/C++ compiler cache (documentation) | https://ccache.dev/
- dnf - ccache - 4.13.6-3.fc45: normalized package name match | Fedora Rawhide package metadata: ccache from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | C/C++ compiler cache | http://ccache.dev/
- pacman - ccache - 4.13.6-1: normalized package name match | Arch Linux sync databases: ccache from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Compiler cache that speeds up recompilation by caching previous compilations | https://ccache.dev/
- zypper - ccache - 4.13.6-1.5: normalized package name match | openSUSE Tumbleweed package metadata: ccache from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A Fast C/C++ Compiler Cache | https://ccache.dev/
- MacPorts - ccache: normalized package name match | MacPorts ports tree: devel/ccache/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - ccache: normalized package name match | Chocolatey community package catalog: ccache from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','capnproto'
- Scoop - main/ccache: normalized package name match | Scoop official bucket manifest trees: bucket/ccache.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Ccache.Ccache: normalized package name match | Windows Package Manager source index: Ccache.Ccache from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

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