# 使用 Homebrew, apk, dnf, MacPorts, Nix, pacman, apt, zypper 安装 cairo

查看 cairo 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cairo
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cairo
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:cairo
- **软件包管理器:** Homebrew
- **版本:** 1.18.4
- **来源摘要:** Vector graphics library with cross-device output support
- **主页:** <https://cairographics.org/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cairo-trace (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.18.4
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

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

### 来源

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


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

## 其他软件包管理器记录

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


## 来源

- 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
