How To Install python-sparqlwrapper on Ubuntu 18.04

In this tutorial we learn how to install python-sparqlwrapper on Ubuntu 18.04. python-sparqlwrapper is SPARQL endpoint interface to Python

Introduction

In this tutorial we learn how to install python-sparqlwrapper on Ubuntu 18.04.

What is python-sparqlwrapper

python-sparqlwrapper is:

This is a wrapper around a SPARQL service. It helps in creating the query URI and, possibly, convert the result into a more manageable format.

This is the Python 2 version of the package.

There are three methods to install python-sparqlwrapper on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-sparqlwrapper Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-sparqlwrapper using apt-get by running the following command:

sudo apt-get -y install python-sparqlwrapper

Install python-sparqlwrapper Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-sparqlwrapper using apt by running the following command:

sudo apt -y install python-sparqlwrapper

Install python-sparqlwrapper Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-sparqlwrapper using aptitude by running the following command:

sudo aptitude -y install python-sparqlwrapper

How To Uninstall python-sparqlwrapper on Ubuntu 18.04

To uninstall only the python-sparqlwrapper package we can use the following command:

sudo apt-get remove python-sparqlwrapper

Uninstall python-sparqlwrapper And Its Dependencies

To uninstall python-sparqlwrapper and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-sparqlwrapper

Remove python-sparqlwrapper Configurations and Data

To remove python-sparqlwrapper configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-sparqlwrapper

Remove python-sparqlwrapper configuration, data, and all of its dependencies

We can use the following command to remove python-sparqlwrapper configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-sparqlwrapper

References

Summary

In this tutorial we learn how to install python-sparqlwrapper package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.