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

Vector graphics library with cross-device output support. Version 1.18.4 via Homebrew; verified from local package data. Also installable with debian: sudo apt install libcairo-gobject2.

## Install

```sh
sudo av install brew:cairo
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cairo
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cairo
```

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

### Linux

- apk (92%):

```sh
sudo apk add cairo
```

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

- dnf (92%):

```sh
sudo dnf install cairo
```

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

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

- pacman (92%):

```sh
sudo pacman -S cairo
```

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

- Debian apt (92%):

```sh
sudo apt install libcairo-gobject2
```

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

- zypper (92%):

```sh
sudo zypper install cairo-devel
```

  Evidence: openSUSE Tumbleweed package metadata: cairo-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:cairo
- **Package manager:** Homebrew
- **Version:** 1.18.4
- **Source summary:** Vector graphics library with cross-device output support
- **Homepage:** <https://cairographics.org/>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- cairo-trace (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 1.18.4
## Project history and usage

Cairo is a C 2D graphics library that provides a PostScript/PDF-like drawing API over multiple output backends, including X11, XCB, Quartz, Win32, image buffers, PDF, PostScript, and SVG.

### Project history

The official repository README says cairo was originally developed by Carl Worth and Keith Packard. Cairo's early identity was a cross-device vector rendering library: the documentation archive points to a 2003 paper under the earlier Xr name and later cairo presentations from 2005.

The 1.0.0 release announcement on 2005-08-24 marked the stable API/ABI line for 1.x.y releases. At that point xlib, image, and win32 were supported backends, while Glitz, PostScript, PDF, Quartz, and XCB were experimental. Modern project documentation lists a wider set of supported targets, including PDF, PostScript, SVG, Quartz, Win32, Xlib, and XCB.

Cairo is tied closely to pixman for pixel compositing and to desktop text/rendering stacks through fontconfig, FreeType, platform font backends, and toolkit bindings. The project continues to publish releases through cairographics.org, with the official news page listing releases up to 1.18.4 in 2025.

### Adoption history

Cairo became infrastructure rather than an end-user app. The official bindings page lists bindings for languages including C++, Haskell, Java, Perl, PHP, Python, Ruby, and others, and notes toolkit integration such as GTK+ 2.8+ support. That binding and toolkit spread made cairo a common dependency in Linux desktop, document, plotting, and image-generation software.

Package-manager adoption is broad: the input facts list Cairo across Homebrew, Debian/Ubuntu, Fedora, Alpine, Arch, MacPorts, Nix, and openSUSE-style packaging. That breadth reflects cairo's role as a shared graphics primitive for higher-level applications.

### How it is used

Developers use cairo to draw vector graphics, text, paths, patterns, and transformed/composited images to screen and file surfaces. Common package builds enable image, PNG, PDF, PostScript, SVG, Xlib, XCB, FreeType, fontconfig, Quartz, or Windows backends depending on platform needs.

The Homebrew package exposes cairo-trace, but most users consume cairo as a library dependency through headers, pkg-config metadata, and language bindings.

### Why package nerds care

Cairo is one of those packages that explains why dependency graphs get deep: a small API surface at the application level hides years of rendering, font, backend, and platform compatibility work. For package nerds it is a foundational desktop graphics dependency, sitting between low-level raster compositing in pixman and higher-level toolkits, browsers, plotting libraries, and document renderers.

Its dual LGPL/MPL licensing, stable 1.x compatibility promise, backend matrix, and language bindings made it unusually reusable across open-source desktop stacks and proprietary-friendly distribution scenarios.

### Timeline

- 2003: Xr-era cross-device vector rendering work precedes the cairo name.
- 2005: cairo 1.0.0 released with a stable 1.x compatibility promise.
- 2008: cairo 1.8.0 release appears in the official news archive.
- 2018: cairo 1.16.0 released.
- 2023: cairo 1.18.0 released.
- 2025: cairo 1.18.4 released.

### Related projects

- pixman is the pixel-manipulation library used by cairo for image compositing.
- Language bindings and adjacent projects include pycairo, cairomm, rcairo, cairo-perl, cairo-ocaml, and cairocffi.
- GTK and other GUI toolkits use cairo as a drawing layer; cairo also targets document formats such as PDF, PostScript, and SVG.

### Sources

- <https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/README.md>
- <https://www.cairographics.org/>
- <https://www.cairographics.org/bindings/>
- <https://www.cairographics.org/documentation/>
- <https://www.cairographics.org/news/>
- <https://www.cairographics.org/news/cairo-1.0.0/>


## Security Notes

library-like package without higher-risk signals.

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

## Other Package-Manager Records

- Debian apt - libcairo-gobject2 - 1.18.4-1+b1: normalized package name match | Debian stable package indexes: libcairo-gobject2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Cairo 2D vector graphics library (GObject library) | https://cairographics.org/
- Debian apt - libcairo-script-interpreter2 - 1.18.4-1+b1: normalized package name match | Debian stable package indexes: libcairo-script-interpreter2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Cairo 2D vector graphics library (script interpreter) | https://cairographics.org/
- Debian apt - libcairo2 - 1.18.4-1+b1: normalized package name match | Debian stable package indexes: libcairo2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Cairo 2D vector graphics library | https://cairographics.org/
- Debian apt - libcairo2-dev - 1.18.4-1+b1: normalized package name match | Debian stable package indexes: libcairo2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for the Cairo 2D graphics library | https://cairographics.org/
- Debian apt - libcairo2-doc - 1.18.4-1: normalized package name match | Debian stable package indexes: libcairo2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation for the Cairo Multi-platform 2D graphics library | https://cairographics.org/
- Nix - cairo: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cairo/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libcairo-gobject2 - 1.18.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcairo-gobject2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Cairo 2D vector graphics library (GObject library) | https://cairographics.org/
- Ubuntu apt - libcairo-script-interpreter2 - 1.18.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcairo-script-interpreter2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Cairo 2D vector graphics library (script interpreter) | https://cairographics.org/
- Ubuntu apt - libcairo2 - 1.18.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcairo2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Cairo 2D vector graphics library | https://cairographics.org/
- Ubuntu apt - libcairo2-dev - 1.18.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcairo2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for the Cairo 2D graphics library | https://cairographics.org/
- Ubuntu apt - libcairo2-doc - 1.18.0-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcairo2-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Documentation for the Cairo Multi-platform 2D graphics library | https://cairographics.org/
- apk - cairo - 1.18.4-r1: normalized package name match | Alpine Linux edge package indexes: cairo from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A vector graphics library | https://cairographics.org/
- apk - cairo-dbg - 1.18.4-r1: normalized package name match | Alpine Linux edge package indexes: cairo-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A vector graphics library (debug symbols) | https://cairographics.org/
- apk - cairo-dev - 1.18.4-r1: normalized package name match | Alpine Linux edge package indexes: cairo-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A vector graphics library (development files) | https://cairographics.org/
- apk - cairo-doc - 1.18.4-r1: normalized package name match | Alpine Linux edge package indexes: cairo-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A vector graphics library (documentation) | https://cairographics.org/
- apk - cairo-gobject - 1.18.4-r1: normalized package name match | Alpine Linux edge package indexes: cairo-gobject from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A vector graphics library (gobject bindings) | https://cairographics.org/


## Combined YAML source

View the package source record on GitHub. [combined/cairo.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cairo.yml)


## Sources

- 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
