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

Library for processing command-line flags. Version 2.3.0 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:gflags
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install gflags
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gflags
```

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

### Linux

- apk (92%):

```sh
sudo apk add gflags
```

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

- Debian apt (92%):

```sh
sudo apt install libgflags-dev
```

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

- dnf (92%):

```sh
sudo dnf install gflags
```

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

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

- pacman (92%):

```sh
sudo pacman -S gflags
```

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

- zypper (92%):

```sh
sudo zypper install gflags
```

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

## Package facts

- **Package key:** brew:gflags
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/gflags>
- **Version:** 2.3.0
- **Source summary:** Library for processing command-line flags
- **Homepage:** <https://gflags.github.io/gflags/>
- **Repository:** <https://github.com/gflags/gflags>
- **Upstream docs:** <https://gflags.github.io/gflags>
- **License:** BSD-3-Clause
- **Source archive:** <https://github.com/gflags/gflags/archive/refs/tags/v2.3.0.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- gflags_completions.sh (cli)
- gflags_completions.sh (alias)

## Build dependencies

- cmake

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.3.0
- Local data: ok
- Upstream repository: https://github.com/gflags/gflags
- Upstream latest detected: v2.3.0 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

gflags is the open-source C++ command-line flags library that began as Google Commandline Flags. Its distinguishing design is that flag definitions can live in the source file that uses them, with the library collecting, parsing, validating, and documenting those flags for an executable.

### Project history

The changelog records a Google Inc. 0.1 release in December 2006, followed by 1.0 in October 2008 and several google-gflags releases through 2011. In January 2012, the project was renamed from google-gflags to gflags as Google stepped back from ownership and Andreas Schuh became maintainer.

### Adoption history

gflags spread through C++ infrastructure because it offered a Google-style alternative to getopt-like parsers: each library or translation unit could declare its own flags, while users still received unified help output and parsing behavior. Later releases emphasized package and build-system integration, including CMake, Bazel, pkg-config, Homebrew, Debian/Ubuntu packages, and vcpkg.

### How it is used

Practitioners add `DEFINE_*` and `DECLARE_*` macros in C++ code, link the library, call the parser during program startup, and then read `FLAGS_name` variables from the relevant code. The installation docs cover use through distro packages, Homebrew, Bazel, vcpkg, and CMake.

### Why package nerds care

gflags matters to package maintainers because it is both a runtime library and a build-system integration target for many C++ projects. The long namespace transition from `google` to `gflags`, plus compatibility for projects such as glog, made ABI and include-path behavior unusually important.

### Timeline

- 2006: Google Inc. released google-gflags 0.1.
- 2008: google-gflags 1.0 was released.
- 2012: google-gflags was renamed to gflags and community ownership began.
- 2014: Version 2.1 switched the build configuration to CMake and changed the default namespace to `gflags`.
- 2015: Version 2.1.2 completed the move from Google Code to GitHub.
- 2025: Version 2.3.0 added maintenance fixes for Bazel, CMake, QNX, and option processing.

### Related projects

- The README points Abseil users to Abseil Flags, noting that an internal fork of the library was re-released as part of Abseil. The gflags organization also includes python-gflags history, which moved to Google's Python repository and later to Abseil Python guidance.

### Sources

- <https://gflags.github.io/gflags/>
- <https://github.com/gflags/gflags>
- <https://github.com/gflags/gflags/blob/main/INSTALL.md>
- <https://raw.githubusercontent.com/gflags/gflags/main/ChangeLog.txt>
- <https://raw.githubusercontent.com/gflags/gflags/main/README.md>


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** gflags
- **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

## Other Package-Manager Records

- Debian apt - libgflags-dev - 2.2.2-2: normalized package name match | Debian stable package indexes: libgflags-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | commandline flags module for C++ (development files) | https://gflags.github.io/gflags/
- Debian apt - libgflags-doc - 2.2.2-2: normalized package name match | Debian stable package indexes: libgflags-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | documentation of gflags | https://gflags.github.io/gflags/
- Debian apt - libgflags2.2 - 2.2.2-2: normalized package name match | Debian stable package indexes: libgflags2.2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | commandline flags module for C++ (shared library) | https://gflags.github.io/gflags/
- Nix - gflags: normalized package name match | nixpkgs package indexes: pkgs/by-name/gf/gflags/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libgflags-dev - 2.2.2-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libgflags-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | commandline flags module for C++ (development files) | https://gflags.github.io/gflags/
- Ubuntu apt - libgflags-doc - 2.2.2-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libgflags-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | documentation of gflags | https://gflags.github.io/gflags/
- Ubuntu apt - libgflags2.2 - 2.2.2-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libgflags2.2 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | commandline flags module for C++ (shared library) | https://gflags.github.io/gflags/
- apk - gflags - 2.3.0-r0: normalized package name match | Alpine Linux edge package indexes: gflags from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The gflags package contains a C++ library that implements commandline flags processing. | https://gflags.github.io/gflags/
- apk - gflags-dev - 2.3.0-r0: normalized package name match | Alpine Linux edge package indexes: gflags-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The gflags package contains a C++ library that implements commandline flags processing. (development files) | https://gflags.github.io/gflags/
- dnf - gflags - 2.2.2-19.fc44: normalized package name match | Fedora Rawhide package metadata: gflags from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Library for commandline flag processing | https://gflags.github.io/gflags/
- dnf - gflags-devel - 2.2.2-19.fc44: normalized package name match | Fedora Rawhide package metadata: gflags-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Development files for gflags | https://gflags.github.io/gflags/
- pacman - gflags - 2.2.2-6: normalized package name match | Arch Linux sync databases: gflags from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | C++ Library for commandline flag processing | https://github.com/schuhschuh/gflags
- zypper - gflags - 2.2.2-4.5: normalized package name match | openSUSE Tumbleweed package metadata: gflags from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Library for commandline flag processing | https://github.com/gflags/gflags
- zypper - gflags-devel - 2.2.2-4.5: normalized package name match | openSUSE Tumbleweed package metadata: gflags-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Development files for the dynamic gflags library | https://github.com/gflags/gflags
- zypper - libgflags2_2 - 2.2.2-4.5: normalized package name match | openSUSE Tumbleweed package metadata: libgflags2_2 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Library for commandline flag processing | https://github.com/gflags/gflags
- MacPorts - gflags: normalized package name match | MacPorts ports tree: devel/gflags/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [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.
- [cmake](https://www.automicvault.com/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [brpc](https://www.automicvault.com/pkg/brew/brpc/) - Popular package that depends on this formula.
- [colmap](https://www.automicvault.com/pkg/brew/colmap/) - Popular package that depends on this formula.
- [fbthrift](https://www.automicvault.com/pkg/brew/fbthrift/) - Popular package that depends on this formula.
- [libgrape-lite](https://www.automicvault.com/pkg/brew/libgrape-lite/) - Popular package that depends on this formula.
- [enchant](https://www.automicvault.com/pkg/brew/enchant/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [lunar-date](https://www.automicvault.com/pkg/brew/lunar-date/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [notcurses](https://www.automicvault.com/pkg/brew/notcurses/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [libvterm](https://www.automicvault.com/pkg/brew/libvterm/) - Shares av.db curated category or tags: cli, developer-tools, library.
- [tre](https://www.automicvault.com/pkg/brew/tre/) - Shares av.db curated category or tags: cli, developer-tools, library.
- [check](https://www.automicvault.com/pkg/brew/check/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [cppunit](https://www.automicvault.com/pkg/brew/cppunit/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [dmalloc](https://www.automicvault.com/pkg/brew/dmalloc/) - Shares av.db curated category or tags: c, cli, developer-tools, library.
- [angle-grinder](https://www.automicvault.com/pkg/brew/angle-grinder/) - Local package facts share a topical domain. Shared terms: cli, command-line, developer, developer-tools, line.
- [ccheck](https://www.automicvault.com/pkg/brew/ccheck/) - Local package facts share a topical domain. Shared terms: c, cli, command-line, developer, developer-tools.

## Combined YAML source

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


## Sources

- 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
