How To Install erlang-p1-xmpp on Ubuntu 18.04

In this tutorial we learn how to install erlang-p1-xmpp on Ubuntu 18.04. erlang-p1-xmpp is Erlang/Elixir XMPP parsing and serialization library

Introduction

In this tutorial we learn how to install erlang-p1-xmpp on Ubuntu 18.04.

What is erlang-p1-xmpp

erlang-p1-xmpp is:

This library provides comprehensive representation of XMPP elements as well as tools to work with them. Every such element is represented by an Erlang record. Most of the library’s code is auto generated and thus considered to be bug free and efficient.

The approach is very similar to ASN.1, Google Protocol Buffers or Apache Thrift: an XML element is transformed into internal language structure (an Erlang record in this case) - the process known as “decoding”. During decoding, validation is also performed, thus well-typed structures are generated, potentially decreasing bugs related to handcrafted parsing. A reverse process known as “encoding” is applied for transforming an Erlang record into an XML element.

This package should be used along with erlang-p1-xml, because it is only able to decode from and encode to structures generated by that library (that is, xmlel() elements).

This library was written for ejabberd which still uses it. It was split off into it’s own project to follow Erlang/OTP guidelines.

There are three methods to install erlang-p1-xmpp 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 erlang-p1-xmpp Using apt-get

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

sudo apt-get update

After updating apt database, We can install erlang-p1-xmpp using apt-get by running the following command:

sudo apt-get -y install erlang-p1-xmpp

Install erlang-p1-xmpp Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install erlang-p1-xmpp using apt by running the following command:

sudo apt -y install erlang-p1-xmpp

Install erlang-p1-xmpp 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 erlang-p1-xmpp using aptitude by running the following command:

sudo aptitude -y install erlang-p1-xmpp

How To Uninstall erlang-p1-xmpp on Ubuntu 18.04

To uninstall only the erlang-p1-xmpp package we can use the following command:

sudo apt-get remove erlang-p1-xmpp

Uninstall erlang-p1-xmpp And Its Dependencies

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

sudo apt-get -y autoremove erlang-p1-xmpp

Remove erlang-p1-xmpp Configurations and Data

To remove erlang-p1-xmpp configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge erlang-p1-xmpp

Remove erlang-p1-xmpp configuration, data, and all of its dependencies

We can use the following command to remove erlang-p1-xmpp configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge erlang-p1-xmpp

References

Summary

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