# Install gdb with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, scoop, zypper

GNU debugger. Version 17.2 via Homebrew; verified 2026-05-10.

## Install

```sh
sudo av install brew:gdb
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install gdb
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gdb
```

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

### Linux

- apk (92%):

```sh
sudo apk add gdb
```

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

- Debian apt (92%):

```sh
sudo apt install gdb
```

  Evidence: Debian stable package indexes: gdb from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install gdb
```

  Evidence: Fedora Rawhide package metadata: gdb 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#gdb
```

  Evidence: nixpkgs package indexes: pkgs/by-name/gd/gdb/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S gdb
```

  Evidence: Arch Linux sync databases: gdb from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install gdb
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/gdb
```

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

## Package facts

- **Package key:** brew:gdb
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/gdb>
- **Version:** 17.2
- **Source summary:** GNU debugger
- **Homepage:** <https://www.gnu.org/software/gdb/>
- **Repository:** <https://sourceware.org/git?p=binutils-gdb.git>
- **Upstream docs:** <https://sourceware.org/gdb/current/onlinedocs/gdb>
- **License:** GPL-3.0-or-later
- **Source archive:** <https://ftpmirror.gnu.org/gnu/gdb/gdb-17.2.tar.xz>
- **Last updated:** 2026-05-10T20:39:26Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- gcore (cli)
- gdb (cli)
- gdb-add-index (cli)
- gdbserver (cli)
- gstack (cli)
- gcore (alias)
- gdb (alias)
- gdb-add-index (alias)
- gdbserver (alias)
- gstack (alias)

## Dependencies

- gmp
- mpfr
- ncurses
- python@3.14
- readline
- xz
- zstd

## Build dependencies

- pkgconf
- texinfo

## Uses from macOS

- expat

## Install behavior

- Post-install hook: not defined
- Caveats: gdb requires special privileges to access Mach ports. You will need to codesign the binary. For instructions, see: https://sourceware.org/gdb/wiki/PermissionsDarwin
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 17.2
- Package-manager updated: 2026-05-10
- Local data: ok
- Upstream repository: https://www.gnu.org/software/gdb/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

GDB is the GNU Project's source-level debugger, used from the command line to run programs under observation, stop them at controlled points, inspect state, and experiment with program execution.

### Project history

The current GDB manual credits Richard Stallman as the original author and describes many later contributors. Its copyright history begins in 1988, placing GDB among the early core GNU development tools.

The manual's contributor history records early releases through 2.8 under Richard Stallman and assistants, later 3.x and 4.x release stewards, and major commercial and community contributions for CPU targets, object formats, remote debugging, gdbserver, the machine interface, and language support.

GDB is maintained in Sourceware's binutils-gdb repository, reflecting its close development relationship with GNU Binutils and the broader GNU toolchain.

### Adoption history

GDB became the default debugger in many Unix-like development environments because it paired a scriptable CLI with broad compiler, architecture, object-file, and language support.

The manual records Cygnus Solutions sponsoring GDB maintenance and much development since 1991, an important phase in professionalizing GNU toolchain support for commercial cross-development and embedded targets.

### How it is used

The manual describes GDB as useful for starting a program, stopping it on specified conditions, examining what happened after it stopped, and changing program state to continue debugging.

GDB supports many languages, including C, C++, D, Go, Objective-C, Fortran, OpenCL C, Pascal, Rust, assembly, Modula-2, and Ada. It also includes remote debugging, gdbserver, TUI, GDB/MI, Python and Guile extension APIs, and Debugger Adapter Protocol support.

### Why package nerds care

GDB is a canonical package-manager debugging tool: small at the command line, but deeply tied to compiler output, debug symbols, libc behavior, architecture support, Python scripting, and remote target workflows.

Its initialization-file search path is platform-sensitive, with XDG-style paths on non-macOS Unix systems and Library/Preferences paths on macOS, which makes packaging and documentation details visible to users.

### Timeline

- 1988: The GDB manual copyright history begins.
- 1991: Cygnus Solutions begins sponsoring GDB maintenance and much of its development.
- 2025: GDB 17.1 is released according to the official news page.
- 2026: GDB 17.2 is released according to the official news page.

### Related projects

- GDB is developed with GNU Binutils in the binutils-gdb repository and relies on BFD for multiple object-file formats.
- Related tools and interfaces include gdbserver, Readline, GDB/MI, the Debugger Adapter Protocol, and frontends such as gdbgui.

### Sources

- <https://sourceware.org/gdb/current/onlinedocs/gdb.html>
- <https://sourceware.org/gdb/current/onlinedocs/gdb.html/Contributors.html>
- <https://sourceware.org/gdb/current/onlinedocs/gdb.html/Initialization-Files.html>
- <https://sourceware.org/gdb/current/onlinedocs/gdb.html/Summary.html>
- <https://sourceware.org/gdb/current/onlinedocs/gdb.html/Supported-Languages.html>
- <https://sourceware.org/gdb/news/>
- <https://sourceware.org/git/?p=binutils-gdb.git>


## Security Notes

doc example: debugger and process inspection tool.

- **Geiger risk:** red / high
- doc example: debugger and process inspection tool


## 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

- macOS: ~/Library/Preferences/gdb/gdbearlyinit, ~/.gdbearlyinit, ~/Library/Preferences/gdb/gdbinit, ~/.gdbinit, ./.gdbinit
- Unix: $XDG_CONFIG_HOME/gdb/gdbearlyinit, ~/.config/gdb/gdbearlyinit, ~/.gdbearlyinit, $XDG_CONFIG_HOME/gdb/gdbinit, ~/.config/gdb/gdbinit, ~/.gdbinit, ./.gdbinit
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** gdb
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - gdb - 16.3-1: normalized package name match | Debian stable package indexes: gdb from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Debugger | https://www.gnu.org/s/gdb/
- Debian apt - gdb-minimal - 16.3-1: normalized package name match | Debian stable package indexes: gdb-minimal from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Debugger (minimal version - dummy transitional package) | https://www.gnu.org/s/gdb/
- Debian apt - gdb-multiarch - 16.3-1: normalized package name match | Debian stable package indexes: gdb-multiarch from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Debugger (with support for multiple architectures) | https://www.gnu.org/s/gdb/
- Debian apt - gdb-source - 16.3-1: normalized package name match | Debian stable package indexes: gdb-source from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Debugger (source) | https://www.gnu.org/s/gdb/
- Debian apt - gdbserver - 16.3-1: normalized package name match | Debian stable package indexes: gdbserver from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | GNU Debugger (remote server) | https://www.gnu.org/s/gdb/
- Nix - gdb: normalized package name match | nixpkgs package indexes: pkgs/by-name/gd/gdb/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gdb - 15.0.50.20240403-0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gdb from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | GNU Debugger | https://www.gnu.org/s/gdb/
- Ubuntu apt - gdb-doc - 15.0.50.20240403-0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gdb-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | The GNU Debugger Documentation | https://www.gnu.org/s/gdb/
- Ubuntu apt - gdb-multiarch - 15.0.50.20240403-0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gdb-multiarch from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Debugger (with support for multiple architectures) | https://www.gnu.org/s/gdb/
- Ubuntu apt - gdb-source - 15.0.50.20240403-0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gdb-source from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Debugger (source) | https://www.gnu.org/s/gdb/
- Ubuntu apt - gdbserver - 15.0.50.20240403-0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: gdbserver from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | GNU Debugger (remote server) | https://www.gnu.org/s/gdb/
- apk - gdb - 16.3-r4: normalized package name match | Alpine Linux edge package indexes: gdb from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Debugger | https://www.gnu.org/software/gdb/
- apk - gdb-dbg - 16.3-r4: normalized package name match | Alpine Linux edge package indexes: gdb-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Debugger (debug symbols) | https://www.gnu.org/software/gdb/
- apk - gdb-doc - 16.3-r4: normalized package name match | Alpine Linux edge package indexes: gdb-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Debugger (documentation) | https://www.gnu.org/software/gdb/
- apk - gdb-multiarch - 16.3-r4: normalized package name match | Alpine Linux edge package indexes: gdb-multiarch from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The GNU Debugger for all supported architectures | https://www.gnu.org/software/gdb/
- dnf - gdb - 17.1-10.fc45: normalized package name match | Fedora Rawhide package metadata: gdb from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A GNU source-level debugger for C, C++, Fortran, Go and other languages | https://gnu.org/software/gdb/


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [ncurses](https://www.automicvault.com/pkg/brew/ncurses/) - Runtime dependency declared by Homebrew.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [xz](https://www.automicvault.com/pkg/brew/xz/) - Runtime dependency declared by Homebrew.
- [zstd](https://www.automicvault.com/pkg/brew/zstd/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [texinfo](https://www.automicvault.com/pkg/brew/texinfo/) - Build dependency declared by Homebrew.
- [gdbgui](https://www.automicvault.com/pkg/brew/gdbgui/) - Popular package that depends on this formula.
- [aarch64-elf-gdb](https://www.automicvault.com/pkg/brew/aarch64-elf-gdb/) - Shares the same upstream homepage.
- [arm-none-eabi-gdb](https://www.automicvault.com/pkg/brew/arm-none-eabi-gdb/) - Shares the same upstream homepage.
- [i386-elf-gdb](https://www.automicvault.com/pkg/brew/i386-elf-gdb/) - Shares the same upstream homepage.
- [riscv64-elf-gdb](https://www.automicvault.com/pkg/brew/riscv64-elf-gdb/) - Shares the same upstream homepage.
- [x86_64-elf-gdb](https://www.automicvault.com/pkg/brew/x86-64-elf-gdb/) - Shares the same upstream homepage.
- [ddd](https://www.automicvault.com/pkg/brew/ddd/) - Shares av.db curated category or tags: cli, debugger, debugging, developer-tools, gdb.
- [valgrind](https://www.automicvault.com/pkg/brew/valgrind/) - Shares av.db curated category or tags: c, c-plus-plus, cli, debugging, developer-tools.
- [bashdb](https://www.automicvault.com/pkg/brew/bashdb/) - Shares av.db curated category or tags: cli, debugger, debugging, developer-tools.
- [delve](https://www.automicvault.com/pkg/brew/delve/) - Shares av.db curated category or tags: cli, debugger, debugging, developer-tools.
- [dmalloc](https://www.automicvault.com/pkg/brew/dmalloc/) - Shares av.db curated category or tags: c, cli, debugging, developer-tools.
- [mspdebug](https://www.automicvault.com/pkg/brew/mspdebug/) - Shares av.db curated category or tags: cli, debugger, debugging, developer-tools.

## Combined YAML source

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


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- 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
