Did you know ... Search Documentation:
SWI-Prolog owl logoSWI-Prolog on Debian and Ubuntu Linux

Linux distributions

The table below describes the Linux distros and SWI-Prolog versions for which the descriptions on this page was last updated. This page is relevant for virtually all Debian-derived distributions (those using apt-get) and many versions of SWI-Prolog.

Debian releaseWheezy(7.0)
Ubuntu release12.04, 14.04
Raspbian (Raspberry pi)Jessie (8.0)
SWI-Prolog release6.6.x, 7.2.x, 7.3.x
Package pagehttp://packages.debian.org/swi-prolog
(Debian) MaintainerEugeniy Meshcheryakov


Debian Squeeze and derived distributions come with a properly packaged but old (version 5.10.4) SWI-Prolog. We advice to compile the sources on older Debian derived distros or you need a fairly recent version.

PPA (Ubuntu Personal Package Archive)

There are PPAs for SWI-Prolog stable and SWI-Prolog development based on the official Debian packaging structure and corresponding SWI-Prolog release. This PPA version can be installed using the commands below in Ubuntu 12.04 and 13.04:

These PPAs are updated with every new release. Thanks to Yves Raimond for setting up the PPA snd Eugeniy Meshcheryakov for creating the Debian configuration. The PPA is registered using apt-add-repository, which is by default available on desktops, but not on servers or Linux containers. It is installed using:

% sudo apt-get install software-properties-common

Stable versions

% sudo apt-add-repository ppa:swi-prolog/stable
% sudo apt-get update
% sudo apt-get install swi-prolog

Development versions

% sudo apt-add-repository ppa:swi-prolog/devel
% sudo apt-get update
% sudo apt-get install swi-prolog


Use the following commands to obtain all dependencies for a full build from source. Note that there are no known version dependencies on any of these packages. If your (debian-based) distribution is lacking any of these package use apt-cache search <name> to find an alternative, where <name> is e.g., libunwind (i.e., remove version and details). Some remarks:

  • It is possible to use iodbc instead of unixodbc for ODBC connectivity.
  • The SWI-Prolog Java interface (JPL) works with many Java development kits, not only openjdk-7-jdk.
  • The package libarchive-dev is needed as of 6.1.4 for libarchive, which is needed by pack_install/1.
  • The package libossp-uuid-dev is needed as of 6.3.4 for library(uuid), which is needed for ClioPatria's SPARQL engine.
  • The package libdb-dev is needed as of 7.3.8 for library(bdb), the BerkeleyDB embedded database interface.
  • libunwind only simplifies debugging in case of a system crash.
sudo apt-get install \
        build-essential autoconf curl chrpath pkg-config \
        ncurses-dev libreadline-dev libunwind8-dev \
        libgmp-dev \
        libssl-dev \
        unixodbc-dev \
        zlib1g-dev libarchive-dev \
        libossp-uuid-dev \
        libxext-dev libice-dev libjpeg-dev libxinerama-dev libxft-dev \
        libxpm-dev libxt-dev \
        libdb-dev \
        openjdk-7-jdk junit

Note that older Debian based distributions, including the Debian stable (Squeeze (6.0)) ship with libunwind7-dev instead of libunwind8-dev.

Raspbian does not have libunwind. Just leave it out. All other packages are available. SWI-Prolog versions 7.3.x require gcc 4.8 or later, provided by Raspbian GNU/Linux 8.0 (jessie). Total build time on a Raspberry pi model 2, including all packages is 22 minutes. If you want to reduce resources, the following packages are optional:

openjdk-7-jdk junit
Without you do not have Java connectivity (JPL)
libxext-dev libice-dev libjpeg-dev libxinerama-dev libxft-dev libxpm-dev libxt-dev
If you leave these out, add xpce to DISABLE_PKGS in build. Means you have no graphics, no graphical development tools and no regular expression support.
Without, you have no ODBC database connectivity (e.g., MySQL)
Without, you have no SSL (and HTTPS) support.
Without, you lack unbounded integer support, rational numbers, good random number generators, etc.

Note that including GMP support makes the memory footprint bigger, but mostly if you have no other applications depending on GMP. All the other optional components are only loaded if you actually use them.

Dependencies to build the documentation

The generated documentation is included the source archives and downloaded by the prepare script when installing from the git source. To rebuild the documentation, the following packages are needed. Check man/README for further instructions.

sudo apt-get install \
        texlive-latex-extra \
        texlive-fonts-extra \
        texlive-fonts-extra-doc \
        texlive-fonts-recommended \