# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, winget, zypper, scoop 安装 swi-prolog

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

## 安装

```sh
sudo av install brew:swi-prolog
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install swi-prolog
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install swi-prolog
```

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

### Linux

- apk (92%):

```sh
sudo apk add swi-prolog
```

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

- Debian apt (92%):

```sh
sudo apt install swi-prolog
```

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

- dnf (92%):

```sh
sudo dnf install swi-prolog
```

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

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

- pacman (92%):

```sh
sudo pacman -S swi-prolog
```

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

- zypper (92%):

```sh
sudo zypper install swipl
```

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

### Windows

- Chocolatey (92%):

```sh
choco install SWI-Prolog
```

  证据: Chocolatey community package catalog: SWI-Prolog from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='8.884','vim-x64'

- winget (92%):

```sh
winget install --id SWI-Prolog.SWI-Prolog -e
```

  证据: Windows Package Manager source index: SWI-Prolog.SWI-Prolog from https://cdn.winget.microsoft.com/cache/source.msix

- Scoop (92%):

```sh
scoop install extras/swipl
```

  证据: Scoop official bucket manifest trees: bucket/swipl.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:swi-prolog
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/swi-prolog>
- **版本:** 10.0.2
- **来源摘要:** ISO/Edinburgh-style Prolog interpreter
- **主页:** <https://www.swi-prolog.org/>
- **仓库:** <https://github.com/SWI-Prolog/swipl-devel>
- **上游文档:** <https://github.com/SWI-Prolog/swipl-devel#readme>
- **许可证:** BSD-2-Clause
- **源码归档:** <https://www.swi-prolog.org/download/stable/src/swipl-10.0.2.tar.gz>
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- swipl (cli)
- swipl-ld (cli)
- swipl-win (cli)
- swipl (别名)
- swipl-ld (别名)
- swipl-win (别名)

## 依赖

- berkeley-db@5
- gmp
- libarchive
- libyaml
- openssl@3
- pcre2
- unixodbc

## 构建依赖

- cmake
- pkgconf

## macOS 提供的库

- libedit
- libxcrypt
- ncurses

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 10.0.2
- 本地数据: OK
- 上游仓库: https://www.swi-prolog.org/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

SWI-Prolog is a long-running open-source implementation of Prolog, packaged for Unix-like systems, Windows package managers, and language-specific workflows. For CLI users it is best known through the swipl executable, an interactive top level, compiler/runtime, and development environment for logic-programming projects.

### 项目历史

The official manual says SWI-Prolog began in 1986 to support recursive interaction between Prolog and C, at a time when Prolog systems were less integrated with their host environments. The project's own site summarizes its public history as starting in 1987 and being driven by real-world application needs.

### 采用历史

SWI-Prolog's documentation describes it as widely used in education and research, and also in 24x7 commercial server processes. The project reports over a million downloads and notes that applications range from student assignments to commercial codebases with more than one million lines of Prolog.

### 使用方式

The normal Unix entry point is swipl. Users start an interactive session, load Prolog source files, run queries, build applications, install packs, or use the runtime in larger systems through C, C++, Java, Python, web, RDF, and other interfaces documented by the project.

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

SWI-Prolog matters to package maintainers because it is both a language runtime and a batteries-included development environment. It has native libraries, optional packages, documentation generation, a pack ecosystem, source builds with submodules, stable and development release tracks, and enough platform reach that packaging it is a real integration exercise rather than a simple single-binary install.

### 时间线

- 1986: Implementation history begins with the need for recursive Prolog and C interaction.
- 1987: Project site describes SWI-Prolog as starting in this year.
- 2007: SWI-Prolog and YAP establish a compatibility framework for portable Prolog programs.
- 2014: Primary git repository moved to GitHub.
- 2026: Official manual describes SWI-Prolog 10.1.x and ongoing stable/development release tracks.

### Related projects

- YAP is named in SWI-Prolog publications around Prolog portability.
- XPCE is historically tied to SWI-Prolog's graphical environment.
- SWISH provides a browser-based SWI-Prolog environment.
- The SWI-Prolog pack system is the project's add-on packaging ecosystem.

### 来源

- <https://github.com/SWI-Prolog/swipl-devel>
- <https://www.swi-prolog.org/>
- <https://www.swi-prolog.org/download/devel>
- <https://www.swi-prolog.org/news/3dc83b48-d138-11e3-9f22-00144fee017c>
- <https://www.swi-prolog.org/pldoc/man?section=implhistory>
- <https://www.swi-prolog.org/pldoc/man?section=status>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** swi-prolog
- **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

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

- Debian apt - swi-prolog - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ISO/Edinburgh-style Prolog interpreter | https://www.swi-prolog.org
- Debian apt - swi-prolog-bdb - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-bdb from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Berkeley DB interface for SWI-Prolog | https://www.swi-prolog.org
- Debian apt - swi-prolog-core - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-core from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ISO/Edinburgh-style Prolog interpreter - core system | https://www.swi-prolog.org
- Debian apt - swi-prolog-core-packages - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-core-packages from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ISO/Edinburgh-style Prolog interpreter - core packages | https://www.swi-prolog.org
- Debian apt - swi-prolog-doc - 9.2.9+dfsg-1: normalized package name match | Debian stable package indexes: swi-prolog-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | documentation and examples for SWI-Prolog | https://www.swi-prolog.org
- Debian apt - swi-prolog-full - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-full from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ISO/Edinburgh-style Prolog interpreter - full suit | https://www.swi-prolog.org
- Debian apt - swi-prolog-java - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-java from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Bidirectional interface between SWI-Prolog and Java | https://www.swi-prolog.org
- Debian apt - swi-prolog-nox - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-nox from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ISO/Edinburgh-style Prolog interpreter - without X support | https://www.swi-prolog.org
- Debian apt - swi-prolog-odbc - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-odbc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ODBC library for SWI-Prolog | https://www.swi-prolog.org
- Debian apt - swi-prolog-test - 9.2.9+dfsg-1: normalized package name match | Debian stable package indexes: swi-prolog-test from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tests and checks for SWI-Prolog | https://www.swi-prolog.org
- Debian apt - swi-prolog-x - 9.2.9+dfsg-1+b1: normalized package name match | Debian stable package indexes: swi-prolog-x from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | User interface library for SWI-Prolog - with X support | https://www.swi-prolog.org
- Nix - swi-prolog: normalized package name match | nixpkgs package indexes: pkgs/by-name/sw/swi-prolog/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - swi-prolog - 9.0.4+dfsg-3.1ubuntu4: normalized package name match | Ubuntu 24.04 LTS package indexes: swi-prolog from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | ISO/Edinburgh-style Prolog interpreter | https://www.swi-prolog.org
- Ubuntu apt - swi-prolog-bdb - 9.0.4+dfsg-3.1ubuntu4: normalized package name match | Ubuntu 24.04 LTS package indexes: swi-prolog-bdb from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Berkeley DB interface for SWI-Prolog | https://www.swi-prolog.org
- Ubuntu apt - swi-prolog-core - 9.0.4+dfsg-3.1ubuntu4: normalized package name match | Ubuntu 24.04 LTS package indexes: swi-prolog-core from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | ISO/Edinburgh-style Prolog interpreter - core system | https://www.swi-prolog.org
- Ubuntu apt - swi-prolog-core-packages - 9.0.4+dfsg-3.1ubuntu4: normalized package name match | Ubuntu 24.04 LTS package indexes: swi-prolog-core-packages from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | ISO/Edinburgh-style Prolog interpreter - core packages | https://www.swi-prolog.org


## 相关链接

- [Secret-risk packages](https://www.automicvault.com/zh-hans/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/zh-hans/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [libarchive](https://www.automicvault.com/zh-hans/pkg/brew/libarchive/) - Runtime dependency declared by Homebrew.
- [openssl@3](https://www.automicvault.com/zh-hans/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pcre2](https://www.automicvault.com/zh-hans/pkg/brew/pcre2/) - Runtime dependency declared by Homebrew.
- [unixodbc](https://www.automicvault.com/zh-hans/pkg/brew/unixodbc/) - Runtime dependency declared by Homebrew.
- [cmake](https://www.automicvault.com/zh-hans/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/zh-hans/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [gnu-prolog](https://www.automicvault.com/zh-hans/pkg/brew/gnu-prolog/) - Shares av.db curated category or tags: cli, compiler, language-runtime, logic-programming, prolog.
- [scryer-prolog](https://www.automicvault.com/zh-hans/pkg/brew/scryer-prolog/) - Shares av.db curated category or tags: cli, language-runtime, logic-programming, prolog.
- [abcl](https://www.automicvault.com/zh-hans/pkg/brew/abcl/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [algol68g](https://www.automicvault.com/zh-hans/pkg/brew/algol68g/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [chicken](https://www.automicvault.com/zh-hans/pkg/brew/chicken/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [clisp](https://www.automicvault.com/zh-hans/pkg/brew/clisp/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [ecl](https://www.automicvault.com/zh-hans/pkg/brew/ecl/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [gambit-scheme](https://www.automicvault.com/zh-hans/pkg/brew/gambit-scheme/) - Shares av.db curated category or tags: cli, compiler, interpreter, language-runtime.
- [crystal](https://www.automicvault.com/zh-hans/pkg/brew/crystal/) - Local package facts share a topical domain. Shared terms: cli, compiler, gmp, language, language-runtime.

## Combined YAML source

View the package source record on GitHub. [combined/swi-prolog.yml](https://github.com/automic-vault/db/blob/main/combined/swi-prolog.yml)


## 来源

- 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
