# Install cppcheck with Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, scoop, winget, zypper

Static analysis of C and C++ code. Version 2.21.0 via Homebrew; verified 2026-07-05.

## Install

```sh
sudo av install brew:cppcheck
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cppcheck
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cppcheck
```

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

### Linux

- apk (92%):

```sh
sudo apk add cppcheck
```

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

- Debian apt (92%):

```sh
sudo apt install cppcheck
```

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

- dnf (92%):

```sh
sudo dnf install cppcheck
```

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

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

- pacman (92%):

```sh
sudo pacman -S cppcheck
```

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

- zypper (92%):

```sh
sudo zypper install cppcheck
```

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

### Windows

- Chocolatey (92%):

```sh
choco install cppcheck
```

  Evidence: Chocolatey community package catalog: cppcheck from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','cmake.portable'

- Scoop (92%):

```sh
scoop install main/cppcheck
```

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

- winget (92%):

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

  Evidence: Windows Package Manager source index: Cppcheck.Cppcheck from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:cppcheck
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cppcheck>
- **Version:** 2.21.0
- **Source summary:** Static analysis of C and C++ code
- **Homepage:** <https://sourceforge.net/projects/cppcheck/>
- **Repository:** <https://github.com/cppcheck-opensource/cppcheck>
- **Upstream docs:** <https://cppcheck.sourceforge.io/>
- **License:** GPL-3.0-or-later
- **Source archive:** <https://github.com/cppcheck-opensource/cppcheck/archive/refs/tags/2.21.0.tar.gz>
- **Last updated:** 2026-07-05T00:14:30+09:00
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- cppcheck (cli)
- cppcheck-htmlreport (cli)
- cppcheck (alias)
- cppcheck-htmlreport (alias)

## Dependencies

- tinyxml2

## Build dependencies

- cmake
- python@3.14

## 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.21.0
- Package-manager updated: 2026-07-05
- Local data: ok
- Upstream repository: https://github.com/cppcheck-opensource/cppcheck
- Upstream latest detected: 2.21.0 (current)
## Project history and usage

Cppcheck is an open-source static analysis tool for C and C++ code. It focuses on bugs that compilers commonly miss, especially undefined behavior and dangerous constructs, while trying to keep false positives low.

### Project history

The upstream README notes that the original name was C++check and was later changed to Cppcheck. It also says that despite the name, Cppcheck is designed for both C and C++.

The GitHub repository was created in March 2009. The README states that the repository moved from danmar/cppcheck to cppcheck-opensource/cppcheck, and the official website now links current source downloads to the cppcheck-opensource GitHub releases.

Cppcheck has kept both command-line and graphical user interfaces. Upstream build documentation covers CMake, Visual Studio, Qt Creator, GNU make, MinGW, and cross-compiling, which explains why it appears in many OS package ecosystems.

### Adoption history

The supplied package facts list Cppcheck across Homebrew, MacPorts, Debian, Ubuntu, Fedora/dnf, Alpine/apk, Arch/pacman, Nix, openSUSE/zypper, Chocolatey, Scoop, winget, and more. Upstream's README also explicitly points users to Homebrew, MacPorts, Conda, Conan, and other distribution channels, while warning that third-party packages may lag releases.

The official website lists integrations with development tools such as Buildbot, CLion, Code::Blocks, CodeLite, Eclipse, and others. That integration footprint is part of why Cppcheck is common in CI and editor workflows.

### How it is used

Cppcheck is used from the command line and GUI to analyze C/C++ projects for memory issues, out-of-bounds access, uninitialized variables, null dereferences, invalid shifts, integer overflows, and other undefined behavior. Upstream also documents addon, rules, and platform data files as part of packaged installs.

### Why package nerds care

Cppcheck is package-significant because static analyzers are often installed as developer tools rather than vendored into one project. Packagers need to track release cadence, optional PCRE/rules support, GUI builds, data-file install paths, and the upstream repository move while preserving a stable cppcheck command for CI.

### Timeline

- 2009: Public GitHub repository created.
- 2025: The upstream README documents the repository move to cppcheck-opensource/cppcheck.
- 2026: Official releases include Cppcheck 2.21.0.

### Related projects

- Cppcheck Premium is the upstream commercial offering with additional checks and support.
- The official website lists editor and CI integrations, including Buildbot, CLion, Code::Blocks, CodeLite, and Eclipse.

### Sources

- <https://api.github.com/repos/cppcheck-opensource/cppcheck>
- <https://raw.githubusercontent.com/danmar/cppcheck/main/readme.md>
- <https://cppcheck.sourceforge.io/>
- <https://api.github.com/repos/cppcheck-opensource/cppcheck/releases?per_page=5>
- <https://sourceforge.net/projects/cppcheck/rss?path=/cppcheck>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** cppcheck
- **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 - cppcheck - 2.17.1-2: normalized package name match | Debian stable package indexes: cppcheck from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for static C/C++ code analysis (CLI) | https://sourceforge.net/p/cppcheck/wiki/Home/
- Debian apt - cppcheck-gui - 2.17.1-2: normalized package name match | Debian stable package indexes: cppcheck-gui from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool for static C/C++ code analysis (GUI) | https://sourceforge.net/p/cppcheck/wiki/Home/
- Nix - cppcheck: normalized package name match | nixpkgs package indexes: pkgs/by-name/cp/cppcheck/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - cppcheck - 2.13.0-2ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: cppcheck from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool for static C/C++ code analysis (CLI) | https://sourceforge.net/p/cppcheck/wiki/Home/
- Ubuntu apt - cppcheck-gui - 2.13.0-2ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: cppcheck-gui from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool for static C/C++ code analysis (GUI) | https://sourceforge.net/p/cppcheck/wiki/Home/
- apk - cppcheck - 2.21.0-r0: normalized package name match | Alpine Linux edge package indexes: cppcheck from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Static analysis tool for C/C++ code | https://cppcheck.sourceforge.io/
- apk - cppcheck-doc - 2.21.0-r0: normalized package name match | Alpine Linux edge package indexes: cppcheck-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Static analysis tool for C/C++ code (documentation) | https://cppcheck.sourceforge.io/
- apk - cppcheck-gui - 2.21.0-r0: normalized package name match | Alpine Linux edge package indexes: cppcheck-gui from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Qt gui for cppcheck | https://cppcheck.sourceforge.io/
- apk - cppcheck-htmlreport - 2.21.0-r0: normalized package name match | Alpine Linux edge package indexes: cppcheck-htmlreport from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Utility to generate a html report of a XML file produced by cppcheck | https://cppcheck.sourceforge.io/
- dnf - cppcheck - 2.21.0-1.fc45: normalized package name match | Fedora Rawhide package metadata: cppcheck from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Tool for static C/C++ code analysis | http://cppcheck.sourceforge.io/
- dnf - cppcheck-gui - 2.21.0-1.fc45: normalized package name match | Fedora Rawhide package metadata: cppcheck-gui from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Graphical user interface for cppcheck | http://cppcheck.sourceforge.io/
- dnf - cppcheck-htmlreport - 2.21.0-1.fc45: normalized package name match | Fedora Rawhide package metadata: cppcheck-htmlreport from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | HTML reporting for cppcheck | http://cppcheck.sourceforge.io/
- pacman - cppcheck - 2.21.0-1: normalized package name match | Arch Linux sync databases: cppcheck from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A tool for static C/C++ code analysis | http://cppcheck.sourceforge.net/
- zypper - cppcheck - 2.21.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: cppcheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | A tool for static C/C++ code analysis | https://github.com/cppcheck-opensource/cppcheck
- zypper - cppcheck-gui - 2.21.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: cppcheck-gui from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | A tool for static C/C++ code analysis | https://github.com/cppcheck-opensource/cppcheck
- MacPorts - cppcheck: normalized package name match | MacPorts ports tree: devel/cppcheck/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [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.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [cmake](https://www.automicvault.com/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Build dependency declared by Homebrew.
- [cflow](https://www.automicvault.com/pkg/brew/cflow/) - Shares av.db curated category or tags: c, cli, developer-tools, static-analysis.
- [sparse](https://www.automicvault.com/pkg/brew/sparse/) - Shares av.db curated category or tags: c, cli, developer-tools, static-analysis.
- [spoa](https://www.automicvault.com/pkg/brew/spoa/) - Shares av.db curated category or tags: c, cli, developer-tools, static-analysis.
- [cbmc](https://www.automicvault.com/pkg/brew/cbmc/) - Shares av.db curated category or tags: c, c-plus-plus, cli, developer-tools, static-analysis.
- [checkstyle](https://www.automicvault.com/pkg/brew/checkstyle/) - Shares av.db curated category or tags: cli, developer-tools, static-analysis.
- [clazy](https://www.automicvault.com/pkg/brew/clazy/) - Shares av.db curated category or tags: cli, developer-tools, static-analysis.
- [credo](https://www.automicvault.com/pkg/brew/credo/) - Shares av.db curated category or tags: cli, developer-tools, static-analysis.
- [datadog-static-analyzer](https://www.automicvault.com/pkg/brew/datadog-static-analyzer/) - Shares av.db curated category or tags: cli, developer-tools, static-analysis.

## Combined YAML source

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