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

Glorious Glasgow Haskell Compilation System. Version 9.14.1 via Homebrew; verified 2026-06-25.

## Install

```sh
sudo av install brew:ghc
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ghc
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ghc
```

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

### Linux

- apk (92%):

```sh
sudo apk add ghc
```

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

- Debian apt (92%):

```sh
sudo apt install ghc
```

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

- dnf (92%):

```sh
sudo dnf install ghc
```

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

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

- pacman (92%):

```sh
sudo pacman -S ghc
```

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

- zypper (92%):

```sh
sudo zypper install ghc
```

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

### Windows

- Chocolatey (92%):

```sh
choco install ghc
```

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

## Package facts

- **Package key:** brew:ghc
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ghc>
- **Version:** 9.14.1
- **Source summary:** Glorious Glasgow Haskell Compilation System
- **Homepage:** <https://haskell.org/ghc/>
- **Repository:** <https://gitlab.haskell.org/ghc/ghc>
- **Upstream docs:** <https://downloads.haskell.org/ghc/9.14.1/docs/users_guide>
- **License:** BSD-3-Clause
- **Source archive:** <https://downloads.haskell.org/~ghc/9.14.1/ghc-9.14.1-src.tar.xz>
- **Last updated:** 2026-06-25T13:37:42+02:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- ghc (cli)
- ghc-9.14.1 (cli)
- ghc-pkg (cli)
- ghc-pkg-9.14.1 (cli)
- ghci (cli)
- ghci-9.14.1 (cli)
- haddock (cli)
- haddock-ghc-9.14.1 (cli)
- hp2ps (cli)
- hp2ps-ghc-9.14.1 (cli)
- hpc (cli)
- hpc-ghc-9.14.1 (cli)
- hsc2hs (cli)
- hsc2hs-ghc-9.14.1 (cli)
- runghc (cli)
- runghc-9.14.1 (cli)
- runhaskell (cli)
- runhaskell-9.14.1 (cli)
- ghc (alias)
- ghc-9.14.1 (alias)
- ghc-pkg (alias)
- ghc-pkg-9.14.1 (alias)
- ghci (alias)
- ghci-9.14.1 (alias)
- haddock (alias)
- haddock-ghc-9.14.1 (alias)
- hp2ps (alias)
- hp2ps-ghc-9.14.1 (alias)
- hpc (alias)
- hpc-ghc-9.14.1 (alias)
- hsc2hs (alias)
- hsc2hs-ghc-9.14.1 (alias)
- runghc (alias)
- runghc-9.14.1 (alias)
- runhaskell (alias)
- runhaskell-9.14.1 (alias)

## Dependencies

- gmp

## Build dependencies

- autoconf
- automake
- python@3.14
- sphinx-doc
- xz

## Uses from macOS

- libffi
- ncurses

## Install behavior

- Post-install hook: 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: 9.14.1
- Package-manager updated: 2026-06-25
- Local data: ok
- Upstream repository: https://haskell.org/ghc/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

The Glasgow Haskell Compiler, usually called GHC, is the reference-grade open-source compiler and interactive environment for Haskell. It supplies the `ghc` compiler, the GHCi interpreter, package tools such as `ghc-pkg`, documentation tooling such as Haddock, and runtime-system support for profiling, parallelism, and native-code execution.

### Project history

GHC began at the University of Glasgow near the beginning of the 1990s as an academic research project funded by the UK government. Its stated goals were practical as well as academic: make a robust and portable Haskell compiler freely available, provide a modular foundation for compiler research, and learn from real programs.

The compiler evolved into a self-hosted Haskell implementation with three major pieces: the compiler, boot libraries, and the runtime system. The runtime system became central to GHC's identity because it handles garbage collection, scheduling, profiling, exceptions, and the execution machinery linked into compiled Haskell programs.

### Adoption history

GHC became the dominant implementation around which the Haskell ecosystem organized. The AOSA chapter by Simon Marlow and Simon Peyton Jones described hundreds of thousands of downloads, thousands of Hackage packages, undergraduate teaching use, and commercial use; the GHC site likewise points users to Hackage libraries, Haskell Language Server, Cabal, Stack, and GHCup.

The Homebrew `ghc` formula packages the general GHC track for macOS users, while separate versioned formulae let projects select older or branch-specific compiler lines. That split mirrors the way Haskell projects often pin compiler versions because language extensions, boot libraries, and package ABI compatibility can matter.

### How it is used

Practitioners use `ghc` for batch compilation, `ghci` for interactive development, `runghc` or `runhaskell` for scripts, `ghc-pkg` for package database inspection, and Haddock for API documentation. The user guide presents GHC as one program that can operate as either an interactive interpreter or a batch compiler.

Build tools such as Cabal and Stack commonly invoke GHC rather than requiring users to call every compiler flag by hand. Advanced users still care about GHC flags directly for optimisation, profiling, language extensions, cross-platform builds, and debugging package database or linker issues.

### Why package nerds care

GHC is package-manager significant because it is both a compiler and a dependency root for much of the Haskell toolchain. Installing the formula affects not only `ghc`, but also GHCi, boot libraries, package metadata, Haddock, profiling tools, and the versioned executable names that allow scripts to target a specific compiler.

The project also embodies a classic language-runtime packaging problem: the compiler is written in Haskell and needs an existing GHC to build, while libraries compiled by one branch may need rebuilding for another. Versioned formulae, GHCup metadata, and project-level pinning all grew around those realities.

### Timeline

- 1990: Haskell was created as a common lazy functional language for research.
- Early 1990s: GHC began as a Glasgow research project with portability, performance, and extensibility goals.
- 2007: The GHC user guide documented the even-numbered stable-branch versioning policy starting with GHC 6.8.
- 2011: The AOSA chapter described GHC as an industrial-strength compiler used in teaching, research, and commercial settings.
- 2025: GHC 9.14.1 release artifacts provided the branch represented by the unversioned Homebrew executable names in this batch input.

### Related projects

- Hackage is the package repository that distributes Haskell libraries built for use with GHC and other tooling.
- GHCup is the Haskell installer that installs GHC along with related tools.
- Cabal, Stack, Haddock, Happy, Alex, and Haskell Language Server form the surrounding toolchain named by GHC's own documentation.

### Sources

- <https://downloads.haskell.org/ghc/9.14.1/docs/users_guide/intro.html>
- <https://formulae.brew.sh/formula/ghc>
- <https://gitlab.haskell.org/ghc/ghc>
- <https://www.aosabook.org/en/v2/ghc.html>
- <https://www.haskell.org/ghc/>
- <https://www.haskell.org/ghcup/>


## Security Notes

compiler and runtime ecosystem.

- **Geiger risk:** yellow / high
- compiler and runtime ecosystem

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ghc
- **Aliases:** ghc@9, ghc@9.14
- **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 - ghc - 9.6.6-4: normalized package name match | Debian stable package indexes: ghc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | The Glasgow Haskell Compilation system | https://haskell.org/ghc/
- Debian apt - ghc-doc - 9.6.6-4: normalized package name match | Debian stable package indexes: ghc-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation for the Glasgow Haskell Compilation system | https://haskell.org/ghc/
- Debian apt - ghc-prof - 9.6.6-4: normalized package name match | Debian stable package indexes: ghc-prof from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Profiling libraries for the Glasgow Haskell Compilation system | https://haskell.org/ghc/
- Nix - ghc: normalized package name match | nixpkgs package indexes: ghc from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - ghc - 9.4.7-3: normalized package name match | Ubuntu 24.04 LTS package indexes: ghc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | The Glasgow Haskell Compilation system | https://haskell.org/ghc/
- Ubuntu apt - ghc-doc - 9.4.7-3: normalized package name match | Ubuntu 24.04 LTS package indexes: ghc-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Documentation for the Glasgow Haskell Compilation system | https://haskell.org/ghc/
- Ubuntu apt - ghc-prof - 9.4.7-3: normalized package name match | Ubuntu 24.04 LTS package indexes: ghc-prof from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Profiling libraries for the Glasgow Haskell Compilation system | https://haskell.org/ghc/
- apk - ghc - 9.10.3-r2: normalized package name match | Alpine Linux edge package indexes: ghc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The Glasgow Haskell Compiler | https://haskell.org/ghc
- apk - ghc-dev - 9.10.3-r2: normalized package name match | Alpine Linux edge package indexes: ghc-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The Glasgow Haskell Compiler (development files) | https://haskell.org/ghc
- apk - ghc-doc - 9.10.3-r2: normalized package name match | Alpine Linux edge package indexes: ghc-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The Glasgow Haskell Compiler (documentation) | https://haskell.org/ghc
- dnf - ghc - 9.10.3-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Glasgow Haskell Compiler | https://haskell.org/ghc/
- dnf - ghc-Cabal - 3.12.1.0-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-Cabal from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Haskell Cabal library | https://hackage.haskell.org/package/Cabal
- dnf - ghc-Cabal-devel - 3.12.1.0-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-Cabal-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Haskell Cabal library development files | https://haskell.org/ghc/
- dnf - ghc-Cabal-doc - 3.12.1.0-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-Cabal-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Haskell Cabal library documentation | https://haskell.org/ghc/
- dnf - ghc-Cabal-prof - 3.12.1.0-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-Cabal-prof from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Haskell Cabal profiling library | https://haskell.org/ghc/
- dnf - ghc-Cabal-syntax - 3.12.1.0-155.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-Cabal-syntax from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Haskell Cabal-syntax library | https://hackage.haskell.org/package/Cabal-syntax


## 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.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [autoconf](https://www.automicvault.com/pkg/brew/autoconf/) - Build dependency declared by Homebrew.
- [automake](https://www.automicvault.com/pkg/brew/automake/) - Build dependency declared by Homebrew.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Build dependency declared by Homebrew.
- [sphinx-doc](https://www.automicvault.com/pkg/brew/sphinx-doc/) - Build dependency declared by Homebrew.
- [ghc@9.10](https://www.automicvault.com/pkg/brew/ghc-9-10/) - Package name indicates the same formula family.
- [ghc@9.12](https://www.automicvault.com/pkg/brew/ghc-9-12/) - Package name indicates the same formula family.
- [ghc@9.6](https://www.automicvault.com/pkg/brew/ghc-9-6/) - Package name indicates the same formula family.
- [ghc@9.8](https://www.automicvault.com/pkg/brew/ghc-9-8/) - Package name indicates the same formula family.
- [abcl](https://www.automicvault.com/pkg/brew/abcl/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [c3c](https://www.automicvault.com/pkg/brew/c3c/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [cython](https://www.automicvault.com/pkg/brew/cython/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [dmd](https://www.automicvault.com/pkg/brew/dmd/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [flang](https://www.automicvault.com/pkg/brew/flang/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [halide](https://www.automicvault.com/pkg/brew/halide/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [idris2](https://www.automicvault.com/pkg/brew/idris2/) - Shares av.db curated category or tags: cli, compiler, language-runtime.
- [inform6](https://www.automicvault.com/pkg/brew/inform6/) - Shares av.db curated category or tags: cli, compiler, language-runtime.

## Combined YAML source

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