How to Install or Uninstall swi-prolog Ubuntu 22.04

Updated: October 30, 2022

SWI-Prolog is a fast and powerful ISO/Edinburgh-style Prolog compiler with a rich set of built-in predicates. It offers a fast, robust and small environment which enables substantial applications to be developed with it. I will show you how to install swi-prolog on Ubuntu 22.04 in this guide.

Prerequisites to install

  • OS: Ubuntu 22.04 is needed for swi-prolog to work
  • Privileges: Ensure that you are able to execute the sudo commands line.

Prerequisites to install swi-prolog on Ubuntu 22.04

Install swi-prolog Ubuntu 22.04

swi-prolog is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install swi-prolog using APT

This is a popular method for installing Ubuntu packages since it’s simple to understand, even if you’re new to Linux. Following these steps to get swi-prolog on your Ubuntu 22.04.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install swi-prolog Ubuntu by pasting this command into the terminal and pressing Enter.

sudo apt -y install swi-prolog

Install swi-prolog using Aptitude

Aptitude allows users to view a list of available packages and manage package installation, upgrade, and removal. If you haven’t already done so, run this command to install it.

sudo apt-get install aptitude

After that, you can now install swi-prolog, just following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt-get -y update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install swi-prolog Ubuntu by pasting this command into the terminal and executing it.

sudo aptitude -y install swi-prolog

Uninstall swi-prolog on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu might be challenging? You’re wrong; any program, not just a swi-prolog, can be easily uninstalled by anyone.

If you installed swi-prolog using APT or Aptitude, you could uninstall swi-prolog on Ubuntu by running this command

sudo apt remove --auto-remove swi-prolog

If you want to uninstall swi-prolog and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge swi-prolog

Conclusion

In this guide, I showed you ways to install swi-prolog on Ubuntu 22.04 and some ways to uninstall swi-prolog too. If you need any help, don’t hesitate to contact me. I’m very glad to answer them.