Join my free Bash scripting course on Udemy 👀

Instal SWI-Prolog on Ubuntu 20.04

April 21, 2022  ‐ 2 min read

For a University class about Multi-agent system, which turned out to be quite an interesting topic, I did need to install SWI-Prolog. All the Windows people in class had an easy time with just downloading the .exe file the professor provided.

It required some searching the SWI-Prolog website for instructions on how to install their software on Ubuntu.

Depending on whether you prefer the stable or development binaries you first need to add the correct Personal Package Archives (PPA) repository.

For the stable binaries (which is probably what you want) you need to run the following command in your terminal:

$ sudo apt-add-repository ppa:swi-prolog/stable

For the development version of SWI-Prolog, which is released about every two to four weeks, you can add the devel PPA:

$ sudo apt-add-repository ppa:swi-prolog/devel

Next you should run an apt update to download package information about the newly added PPA repository.

$ sudo apt update

At last you can install SWI-Prolog itself.

$ sudo apt install swi-prolog

In short

In short, you can install SWI-Prolog stable on Ubuntu by running the following three commands in your terminal.

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