How to Install the Latest Erlang on Ubuntu Linux

Want to learn or code in Erlang? Learn how you can easily install Erlang on Ubuntu. Also learn about installing the latest version of Erlang using the official repositories.
Warp Terminal

Erlang is a functional programming language for building massive scalable real-time systems. Originally created by Ericsson as a proprietary software, Erlang was later open sourced.

Erlang is available in the Universe repository of Ubuntu. With that repository enabled, you can easily install it using the following command:

sudo apt install erlang
Install Erlang Ubuntu

However, the Erlang version offered by Ubuntu repositories may not be the latest.

If you want the latest Erlang version on Ubuntu, you have two ways:

If you had installed a package named erlang previously, it will be upgraded to the newer version offered by the added repository.

Method 1: Install the latest Erlang using PPA

The good thing is that the RabbitMQ team maintains a PPA that lets you easily install the latest version of Erlang on Ubuntu-based distributions.

This is valid for Ubuntu 22.04 and 20.04.

Open a terminal and use the following commands one by one:

sudo add-apt-repository ppa:rabbitmq/rabbitmq-erlang
sudo apt update
sudo apt install erlang

If you already have Erlang installed from Ubuntu's repositories, it will be upgraded to the version provided by the PPA.

Remove Erlang and the PPA

To uninstall the Erlang version removed from the PPA and move it back to the version provided by the Ubuntu repositories, use PPA Purge.

sudo apt install ppa-purge
sudo ppa-purge ppa:rabbitmq/rabbitmq-erlang

You can remove Erlang completely instead of downgrading it with:

sudo apt remove erlang
What is PPA Purge? How to Use it in Ubuntu?
PPA Purge not only disables a PPA from the system but also reverts the packages it installed to their official version. Learn more about it.

Method 2: Installing the latest version of Erlang on Ubuntu 20.04 and 18.04

Erlang developers provide prebuilt binaries for various Linux distributions, Windows and macOS.

You’ll need to download the key file in Linux terminal. You can use wget tool for that so make sure that you have it installed:

sudo apt install wget

Next, use wget to download the GPG key of the Erlang Solution repository and add it your apt packaging system. With the key added, your system will trust the packages coming from the repository.

wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -

Now, you should add a file for Erlang in your APT sources.list.d directory. This file will contain the information about the repository and the APT package manager will use it for getting the packages and any future updates to it.

For Ubuntu 20.04 (and Ubuntu 20.10) use the following:

echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list

I know that the above command mentions focal (for Ubuntu 20.04) but it also works for Ubuntu 20.10 groovy.

For Ubuntu 18.04, use the following:

echo "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list

You must update the local package cache to inform it about the packages from the newly added repository:

sudo apt update

You’ll notice that it suggests several upgrades. If you list the available upgrades, you’ll find erlang packages there. To update the existing erlang version or install it afresh, use this command:

sudo apt install erlang

Once installed, you can test it out.

erlang shell

To quit the Erlang shell, use Ctrl+g and then enter q. I had to do a hit and try to figure that out because I had never used Erlang before.

Removing Erlang

To remove the program, use the following command:

sudo apt remove erlang

There will be a few dependencies left. You can remove them with the following command:

sudo apt autoremove

If you want, you may also remove the added repository file:

sudo rm /etc/apt/sources.list.d/erlang-solution.list

That’s about it. Enjoy learning and coding with Erlang on Ubuntu Linux.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.