# 使用 Homebrew, apk, dnf, MacPorts, Nix, zypper 安装 xkbcomp

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

## 安装

```sh
sudo av install brew:xkbcomp
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install xkbcomp
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install xkbcomp
```

  证据: MacPorts ports tree: x11/xkbcomp/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add xkbcomp
```

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

- dnf (92%):

```sh
sudo dnf install xkbcomp
```

  证据: Fedora Rawhide package metadata: xkbcomp 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#xkbcomp
```

  证据: nixpkgs package indexes: pkgs/by-name/xk/xkbcomp/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install xkbcomp
```

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

## 软件包事实

- **软件包键:** brew:xkbcomp
- **软件包管理器:** Homebrew
- **版本:** 1.5.0
- **来源摘要:** XKB keyboard description compiler
- **主页:** <https://www.x.org>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- xkbcomp (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

xkbcomp is the X Keyboard Extension keymap compiler. It turns human-readable XKB keyboard descriptions into compiled keymaps for X servers and utilities, and can also reverse a running display or compiled map back into resolved XKB source.

### 项目历史

The manual page identifies xkbcomp as a compiler for XKB keyboard descriptions and carries 1994 copyright lines for Silicon Graphics Computer Systems and the X Consortium, with Erik Fortune of Silicon Graphics listed as author. That places the tool in the original XKB work that extended X11 keyboard handling beyond the older core protocol.

As X11 moved through XFree86 and X.Org, xkbcomp remained the low-level compiler behind keyboard layout composition. The X.Org XKB page now points users toward xkeyboard-config for the maintained data files, while the xkbcomp source is maintained as an X.Org application project on freedesktop.org.

### 采用历史

xkbcomp was adopted because XKB itself became the standard keyboard model for X11 systems. Desktop environments and users usually interact with higher-level tools such as setxkbmap or desktop settings, but xkbcomp sits underneath them as the program that verifies, resolves, compiles, dumps, or uploads the actual keymap.

The tool also became a favorite diagnostic and customization utility for keyboard-layout specialists. Documentation and community examples commonly use `xkbcomp :0 -` to inspect the active keymap or `xkbcomp file.xkb $DISPLAY` to load a custom map into a running X server.

### 使用方式

Common package usage is compiling `.xkb` source into `.xkm` files, generating resolved XKB source from a display or compiled map, updating the keymap for a running X display, and producing C headers for servers or utilities that need built-in default keymaps.

For layout authors, xkbcomp is the last mile after editing keycodes, types, compat, symbols, and geometry files. It checks that those pieces merge into a complete keymap and reports warnings at selectable verbosity levels.

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

xkbcomp is classic Unix desktop substrate: rarely glamorous, but essential when packaging X servers, keyboard data, desktop sessions, remote desktops, or custom layouts. It is also a good example of a compiler whose input language is configuration rather than application code.

For package maintainers, its significance comes from being split from the keyboard-layout data it consumes. xkeyboard-config supplies the evolving layout corpus; xkbcomp supplies the compiler that XKB-capable systems rely on to consume that corpus.

### 时间线

- 1994: The xkbcomp manual page records Silicon Graphics/X Consortium copyright and Erik Fortune as author.
- 1996: The original XKB protocol and library specifications were published for X11R6-era XKB.
- 2002: XKB enhancement documentation described xkbcomp as the ordinary compiler used to prepare compiled keyboard configuration for the X server.
- 2004: XFree86 4.3 and X11R6.7-era documentation described multi-layout XKB configuration handled through the same compiled keymap model.
- 2010s-2020s: X.Org keeps xkbcomp as a separate application while XKB data files are maintained by xkeyboard-config.

### Related projects

- xkeyboard-config supplies the keyboard models, layouts, variants, and options that xkbcomp compiles. setxkbmap selects XKB layouts at a higher level. libxkbcommon reuses XKB concepts outside the X server world, especially for Wayland compositors.

### 来源

- <https://cgit.freedesktop.org/xorg/app/xkbcomp/tree/README.enhancing?id=8eb2e1fcd08a05f296a31dbadde1ec3cc84d8e28>
- <https://www.x.org/XKB/>
- <https://xkbcommon.org/doc/current/introduction-to-xkb.html>
- <https://xkbcommon.org/doc/current/user-configuration.html>
- <https://xorg.freedesktop.org/archive/X11R7.5/doc/man/man1/xkbcomp.1.html>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

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

- Nix - xkbcomp: normalized package name match | nixpkgs package indexes: pkgs/by-name/xk/xkbcomp/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - xkbcomp - 1.5.0-r0: normalized package name match | Alpine Linux edge package indexes: xkbcomp from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XKBD keymap compiler | https://xorg.freedesktop.org
- apk - xkbcomp-dev - 1.5.0-r0: normalized package name match | Alpine Linux edge package indexes: xkbcomp-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XKBD keymap compiler (development files) | https://xorg.freedesktop.org
- apk - xkbcomp-doc - 1.5.0-r0: normalized package name match | Alpine Linux edge package indexes: xkbcomp-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | XKBD keymap compiler (documentation) | https://xorg.freedesktop.org
- dnf - xkbcomp - 1.5.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: xkbcomp from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | XKB keymap compiler | https://www.x.org
- dnf - xkbcomp-devel - 1.5.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: xkbcomp-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | XKB keymap compiler development package | https://www.x.org
- zypper - xkbcomp - 1.5.0-1.5: normalized package name match | openSUSE Tumbleweed package metadata: xkbcomp from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Utility to compile XKB keyboard description | https://xorg.freedesktop.org/
- zypper - xkbcomp-devel - 1.5.0-1.5: normalized package name match | openSUSE Tumbleweed package metadata: xkbcomp-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Utility to compile XKB keyboard description -- Development Files | https://xorg.freedesktop.org/
- MacPorts - xkbcomp: normalized package name match | MacPorts ports tree: x11/xkbcomp/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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