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

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

## 安装

```sh
sudo av install brew:swtpm
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install swtpm
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add swtpm
```

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

- Debian apt (92%):

```sh
sudo apt install swtpm
```

  证据: Debian stable package indexes: swtpm from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install swtpm
```

  证据: Fedora Rawhide package metadata: swtpm from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#swtpm
```

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

- pacman (92%):

```sh
sudo pacman -S swtpm
```

  证据: Arch Linux sync databases: swtpm from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install swtpm
```

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

## 软件包事实

- **软件包键:** brew:swtpm
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/swtpm>
- **版本:** 0.10.1
- **来源摘要:** Software TPM Emulator based on libtpms
- **主页:** <https://github.com/stefanberger/swtpm>
- **仓库:** <https://github.com/stefanberger/swtpm>
- **许可证:** BSD-3-Clause
- **源码归档:** <https://github.com/stefanberger/swtpm/archive/refs/tags/v0.10.1.tar.gz>
- **最后更新:** 2026-07-13T17:31:48+09:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- swtpm (cli)
- swtpm_bios (cli)
- swtpm_cert (cli)
- swtpm_ioctl (cli)
- swtpm_localca (cli)
- swtpm_setup (cli)
- swtpm (别名)
- swtpm_bios (别名)
- swtpm_cert (别名)
- swtpm_ioctl (别名)
- swtpm_localca (别名)
- swtpm_setup (别名)

## 依赖

- gettext
- glib
- gmp
- json-glib
- libtasn1
- libtpms
- openssl@3

## 构建依赖

- autoconf
- automake
- gawk
- libtool
- pkgconf
- socat

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.10.1
- 管理器更新时间: 2026-07-13
- 本地数据: OK
- 上游仓库: https://github.com/stefanberger/swtpm
- 检测到的最新版本: v0.10.1 (当前)
## 项目历史与用法

swtpm is a libtpms-based software TPM emulator with socket, character-device, and Linux CUSE interfaces. It is a command-line and service-oriented building block for virtual TPM workflows in QEMU, libvirt, testing, and confidential-computing-adjacent development.

### 项目历史

The upstream README credits David Safford and Stefan Berger and describes a package that provides TPM emulators with different front-end interfaces to libtpms. It also ships tools for using the emulator, creating TPM certificates, and simulating TPM manufacturing by creating endorsement-key and platform certificates.

### 采用历史

The input package facts show swtpm packaged across Homebrew, Alpine, Debian, Fedora, Nix, Arch, Ubuntu, and openSUSE. The upstream wiki includes build instructions for Ubuntu/Debian, RHEL, openSUSE, Alpine, OpenBSD, Cygwin, and macOS, reflecting a project maintained for distribution packaging and virtualization integration rather than a single application bundle.

### 使用方式

Common usage is to run the swtpm emulator as part of a virtual-machine stack, control it with swtpm_ioctl, prepare state with swtpm_setup, and use supporting tools such as swtpm_cert and swtpm_localca for certificate-related TPM setup. The README directs users to per-tool READMEs and the wiki for operational details.

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

Package nerds care because swtpm is infrastructure glue: a small C/Shell-heavy package that lets VM stacks expose TPM functionality reproducibly. Its packaging footprint matters because TPM emulation is only useful when libtpms, QEMU/libvirt integration, init scripts, config files, and distro build flags line up.

### 时间线

- v0.1.0 era: The upstream repository exposes early v0.1.x release tags.
- 2025: GitHub lists v0.10.1 as the latest swtpm release on April 30, 2025.
- Current packaging: The input package facts list swtpm in Homebrew and major Linux package ecosystems.

### Related projects

- Related projects and topics include libtpms, QEMU, libvirt, TPM 1.2/2.0 tooling, virtual TPM devices, and distro packaging for virtualization hosts.

### 来源

- <https://github.com/stefanberger/swtpm>
- <https://github.com/stefanberger/swtpm/blob/master/README>
- <https://github.com/stefanberger/swtpm/wiki>
- source_facts.executables
- source_facts.package-manager


## 安全说明

没有找到 swtpm 的匹配本地密钥处理 manifest。软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ${XDG_CONFIG_HOME}/swtpm_setup.conf, ${HOME}/.config/swtpm_setup.conf, /etc/swtpm_setup.conf, /etc/swtpm-localca.conf, /etc/swtpm-localca.options
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** swtpm
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

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

- Debian apt - swtpm - 0.7.1-1.5: normalized package name match | Debian stable package indexes: swtpm from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Libtpms-based TPM emulator | https://github.com/stefanberger/swtpm
- Debian apt - swtpm-dev - 0.7.1-1.5: normalized package name match | Debian stable package indexes: swtpm-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Include files for the TPM emulator's CUSE interface | https://github.com/stefanberger/swtpm
- Debian apt - swtpm-libs - 0.7.1-1.5: normalized package name match | Debian stable package indexes: swtpm-libs from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Common libraries for TPM emulators | https://github.com/stefanberger/swtpm
- Debian apt - swtpm-tools - 0.7.1-1.5: normalized package name match | Debian stable package indexes: swtpm-tools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tools for the TPM emulator | https://github.com/stefanberger/swtpm
- Nix - swtpm: normalized package name match | nixpkgs package indexes: pkgs/by-name/sw/swtpm/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - swtpm - 0.7.3-0ubuntu5: normalized package name match | Ubuntu 24.04 LTS package indexes: swtpm from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Libtpms-based TPM emulator
- Ubuntu apt - swtpm-tools - 0.7.3-0ubuntu5: normalized package name match | Ubuntu 24.04 LTS package indexes: swtpm-tools from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Tools for the TPM emulator
- apk - swtpm - 0.10.1-r2: normalized package name match | Alpine Linux edge package indexes: swtpm from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface | https://github.com/stefanberger/swtpm
- apk - swtpm-dev - 0.10.1-r2: normalized package name match | Alpine Linux edge package indexes: swtpm-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface (development files) | https://github.com/stefanberger/swtpm
- apk - swtpm-doc - 0.10.1-r2: normalized package name match | Alpine Linux edge package indexes: swtpm-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface (documentation) | https://github.com/stefanberger/swtpm
- dnf - swtpm - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | TPM Emulator | https://github.com/stefanberger/swtpm
- dnf - swtpm-devel - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Include files for the TPM emulator's CUSE interface for usage by clients | https://github.com/stefanberger/swtpm
- dnf - swtpm-libs - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm-libs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Private libraries for swtpm TPM emulators | https://github.com/stefanberger/swtpm
- dnf - swtpm-selinux - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm-selinux from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | SELinux security policy for swtpm | https://github.com/stefanberger/swtpm
- dnf - swtpm-tests - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm-tests from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Installed swtpm tests | https://github.com/stefanberger/swtpm
- dnf - swtpm-tools - 0.10.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: swtpm-tools from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Tools for the TPM emulator | https://github.com/stefanberger/swtpm


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Security and crypto packages](https://pkg.so/zh-hans/security-crypto-tools/) - Matched security, identity, cryptography, password, signing, or certificate metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [glib](https://pkg.so/zh-hans/brew/glib/) - Runtime dependency declared by Homebrew.
- [gettext](https://pkg.so/zh-hans/brew/gettext/) - Runtime dependency declared by Homebrew.
- [libtasn1](https://pkg.so/zh-hans/brew/libtasn1/) - Runtime dependency declared by Homebrew.
- [json-glib](https://pkg.so/zh-hans/brew/json-glib/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [libtool](https://pkg.so/zh-hans/brew/libtool/) - Build dependency declared by Homebrew.
- [autoconf](https://pkg.so/zh-hans/brew/autoconf/) - Build dependency declared by Homebrew.
- [automake](https://pkg.so/zh-hans/brew/automake/) - Build dependency declared by Homebrew.
- [gotpm](https://pkg.so/zh-hans/brew/gotpm/) - Shares pkgdb curated category or tags: cli, security, tpm.
- [gnutls](https://pkg.so/zh-hans/brew/gnutls/) - Shares pkgdb curated category or tags: cli, security.
- [krb5](https://pkg.so/zh-hans/brew/krb5/) - Shares pkgdb curated category or tags: cli, security.
- [nettle](https://pkg.so/zh-hans/brew/nettle/) - Shares pkgdb curated category or tags: cli, security.
- [libcap](https://pkg.so/zh-hans/brew/libcap/) - Shares pkgdb curated category or tags: cli, security.
- [nss](https://pkg.so/zh-hans/brew/nss/) - Shares pkgdb curated category or tags: cli, security.
- [pinentry](https://pkg.so/zh-hans/brew/pinentry/) - Shares pkgdb curated category or tags: cli, security.
- [libassuan](https://pkg.so/zh-hans/brew/libassuan/) - Shares pkgdb curated category or tags: cli, security.
- [libjcat](https://pkg.so/zh-hans/brew/libjcat/) - Both packages work with overlapping file formats or content types. Shared terms: cli, gettext, glib, json, json-glib.
- [osslsigncode](https://pkg.so/zh-hans/brew/osslsigncode/) - Security-sensitive metadata or terminology overlaps. Shared terms: based, cli, openssl, openssl-3, security.
- [retdec](https://pkg.so/zh-hans/brew/retdec/) - Security-sensitive metadata or terminology overlaps. Shared terms: based, cli, openssl, openssl-3, security.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
