# 使用 Homebrew, apk, apt, dnf, Nix, pacman, zypper, scoop 安装 gcc

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

## 安装

```sh
sudo av install brew:gcc
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gcc
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add gcc
```

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

- Debian apt (92%):

```sh
sudo apt install gcc
```

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

- dnf (92%):

```sh
sudo dnf install gcc
```

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

  证据: nixpkgs package indexes: gcc from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S gcc
```

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

- zypper (92%):

```sh
sudo zypper install gcc
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/gcc
```

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

## 软件包事实

- **软件包键:** brew:gcc
- **软件包管理器:** Homebrew
- **版本:** 16.1.0
- **来源摘要:** GNU compiler collection
- **主页:** <https://gcc.gnu.org/>
- **最后更新:** 2026-08-01T16:37:40-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- aarch64-unknown-linux-gnu-c++-16 (别名)
- aarch64-unknown-linux-gnu-g++-16 (别名)
- aarch64-unknown-linux-gnu-gcc-16 (别名)
- aarch64-unknown-linux-gnu-gcc-ar-16 (别名)
- aarch64-unknown-linux-gnu-gcc-nm-16 (别名)
- aarch64-unknown-linux-gnu-gcc-ranlib-16 (别名)
- aarch64-unknown-linux-gnu-gfortran-16 (别名)
- aarch64-unknown-linux-gnu-gm2-16 (别名)
- c++-16 (别名)
- cpp-16 (别名)
- g++-16 (别名)
- gcc-16 (别名)
- gcc-ar-16 (别名)
- gcc-nm-16 (别名)
- gcc-ranlib-16 (别名)
- gcov-16 (别名)
- gcov-dump-16 (别名)
- gcov-tool-16 (别名)
- gfortran (别名)
- gfortran-16 (别名)
- gm2 (别名)
- gm2-16 (别名)
- lto-dump-16 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

GCC, the GNU Compiler Collection, is the GNU project's long-running compiler suite and one of the central packages in free-software toolchains. It is both a user-facing compiler driver family and a distribution-building dependency for C, C++, Fortran, Objective-C, Ada, Go-related runtime pieces, and other GCC-supported languages and targets.

### 项目历史

The official release timeline lists GCC 0.9 as the first beta release in March 1987 and GCC 1.0 in May 1987. The project later absorbed the EGCS line: the timeline records EGCS 1.0 in December 1997, EGCS 1.1.x through March 1999, and GCC 2.95 in July 1999, the release family generally associated with the reunited GCC project.

### 采用历史

The GCC mission statement frames the project as part of GNU and explicitly targets the GNU system, GNU/Linux, multiple architectures, and diverse platforms. This open-development and multi-target mission is why GCC became a default compiler in many Unix-like operating systems and remains a package-manager anchor: large parts of a distribution are either built by it, bootstrap it, or carry compatibility logic for it.

### 使用方式

Package users normally invoke compiler drivers such as gcc, g++, cpp, gfortran, gcov, and lto-dump, while packagers care about release branches, source tarballs, bootstrapping requirements, generated files in Git checkouts, and runtime-library licensing. The official Git page documents cloning from https://gcc.gnu.org/git/gcc.git, release branches under releases/gcc-N, and release tags such as releases/gcc-X.Y.0.

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

GCC is package-manager infrastructure, not just another package. It drives ABI compatibility, bootstrap chains, language standard defaults, libstdc++ behavior, cross-compilation targets, build flags, sanitizer support, and the difference between a distribution that can rebuild itself and one that cannot.

### 时间线

- 1987: GCC 0.9 first beta release.
- 1987: GCC 1.0 released.
- 1997: EGCS 1.0 released as a parallel compiler line.
- 1999: GCC 2.95 released after the EGCS era.
- 2001: GCC 3.0 released.
- 2005: GCC 4.0.0 released.
- 2015: GCC 5.1 released under the modern major-version release scheme.
- 2025: GCC 15.1 released.
- 2026: GCC 16.1 released.

### Related projects

- GCC is tied to the GNU Project, GNU/Linux distributions, libstdc++, binutils, GDB, the GNU build toolchain, and competing or complementary compilers such as Clang/LLVM. Its own official Git documentation also treats release branches and tags as first-class package artifacts.

### 来源

- <https://gcc.gnu.org/>
- <https://gcc.gnu.org/gccmission.html>
- <https://gcc.gnu.org/git.html>
- <https://gcc.gnu.org/onlinedocs/>
- <https://gcc.gnu.org/releases.html>


## 安全说明

compiler and toolchain runtime.

- **Geiger 风险:** yellow / 高
- compiler and toolchain runtime

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

- Debian apt - gcc - 4:14.2.0-1: normalized package name match | Debian stable package indexes: gcc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU C compiler
- Nix - gcc: normalized package name match | nixpkgs package indexes: gcc from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - gcc - 4:13.2.0-7ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gcc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNU C compiler
- apk - g++ - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: g++ from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU C++ standard library and compiler | https://gcc.gnu.org
- apk - gcc - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Compiler Collection | https://gcc.gnu.org
- apk - gcc-doc - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Compiler Collection (documentation) | https://gcc.gnu.org
- apk - gcc-gdb - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-gdb from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Compiler Collection (gdb printers) | https://gcc.gnu.org
- apk - gcc-gdc - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-gdc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GCC-based D language compiler | https://gcc.gnu.org
- apk - gcc-gnat - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-gnat from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Ada support for GCC | https://gcc.gnu.org
- apk - gcc-go - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-go from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GCC Go frontend (intended for bootstrapping community/go) | https://gcc.gnu.org
- apk - gcc-objc - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gcc-objc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU Objective-C | https://gcc.gnu.org
- apk - gfortran - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: gfortran from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU Fortran Compiler | https://gcc.gnu.org
- apk - libatomic - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: libatomic from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GCC Atomic library | https://gcc.gnu.org
- apk - libgcc - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: libgcc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU C compiler runtime libraries | https://gcc.gnu.org
- apk - libgcc-static - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: libgcc-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GNU C compiler runtime libraries | https://gcc.gnu.org
- apk - libgccjit - 15.2.0-r8: normalized package name match | Alpine Linux edge package indexes: libgccjit from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GCC JIT Library | https://gcc.gnu.org


## 相关链接

- [gcc](https://pkg.so/zh-hans/pkg/cargo/gcc/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

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