How To Install libsfml-dev on Ubuntu 18.04

In this tutorial we learn how to install libsfml-dev on Ubuntu 18.04. libsfml-dev is Simple and Fast Multimedia Library - Development Files

Introduction

In this tutorial we learn how to install libsfml-dev on Ubuntu 18.04.

What is libsfml-dev

libsfml-dev is:

SFML is a modern multimedia library offering a wide range of subsystems useful to produce a multimedia app. It offers OpenGL integration for Hardware accelerated Graphics, Windowing and Input support, Audio and Network facilities and supports GNU/Linux, MS Windows and Mac OS X.

This package includes header files for all SFML libraries.

There are three methods to install libsfml-dev 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 libsfml-dev Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libsfml-dev

Install libsfml-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libsfml-dev

Install libsfml-dev 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 libsfml-dev using aptitude by running the following command:

sudo aptitude -y install libsfml-dev

How To Uninstall libsfml-dev on Ubuntu 18.04

To uninstall only the libsfml-dev package we can use the following command:

sudo apt-get remove libsfml-dev

Uninstall libsfml-dev And Its Dependencies

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

sudo apt-get -y autoremove libsfml-dev

Remove libsfml-dev Configurations and Data

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

sudo apt-get -y purge libsfml-dev

Remove libsfml-dev configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libsfml-dev

References

Summary

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