How To Install python-ruamel.yaml on Ubuntu 18.04

In this tutorial we learn how to install python-ruamel.yaml on Ubuntu 18.04. python-ruamel.yaml is roundtrip YAML parser/emitter (Python 2 module)

Introduction

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

What is python-ruamel.yaml

python-ruamel.yaml is:

ruamel.yaml is a YAML parser supporting roundtrip preservation of comments, seq/map flow style and map key order. It is a derivative of Kirill Simonov’s PyYAML 3.11 which supports YAML1.1.

This package contains the Python 2 module.

There are three methods to install python-ruamel.yaml 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-ruamel.yaml 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-ruamel.yaml using apt-get by running the following command:

sudo apt-get -y install python-ruamel.yaml

Install python-ruamel.yaml Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-ruamel.yaml

Install python-ruamel.yaml 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-ruamel.yaml using aptitude by running the following command:

sudo aptitude -y install python-ruamel.yaml

How To Uninstall python-ruamel.yaml on Ubuntu 18.04

To uninstall only the python-ruamel.yaml package we can use the following command:

sudo apt-get remove python-ruamel.yaml

Uninstall python-ruamel.yaml And Its Dependencies

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

sudo apt-get -y autoremove python-ruamel.yaml

Remove python-ruamel.yaml Configurations and Data

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

sudo apt-get -y purge python-ruamel.yaml

Remove python-ruamel.yaml configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-ruamel.yaml

References

Summary

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