How to Install Elixir on Elementary OS Latest
Elixir is a functional programming language that runs on the Erlang virtual machine, known for its performance, scalability, and fault-tolerance. This tutorial will guide you through the process of installing Elixir on the latest version of Elementary OS.
Prerequisites
Before proceeding with the installation process, make sure that your system is up-to-date by running the following command in the terminal:
sudo apt update && sudo apt upgrade
Step 1 – Install Dependencies
The first step is to install the dependencies required for Elixir, including the Erlang programming language, which is a prerequisite for Elixir. Run the following command to install Erlang from the official repository:
sudo apt install erlang
Once the installation is complete, run the following command to install other dependencies required for Elixir:
sudo apt install build-essential autoconf libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop
Step 2 – Install Elixir
After installing the dependencies, you can download the latest version of Elixir from the official website https://elixi.re. You can either download the source code or precompiled packages.
If you want to install the latest version of Elixir using the precompiled package, follow these steps:
Go to https://elixi.re and download the latest precompiled package for Linux.
Open a terminal and navigate to the directory where the package is downloaded.
Unpack the package using the following command:
tar xf elixir-x.y.z-precompiled.zipReplace x.y.z with the version number of the package.
Move the unpacked directory to the /opt directory using the following command:
sudo mv elixir-x.y.z /opt/Create a symbolic link to the Elixir binary in the /usr/local/bin directory using the following command:
sudo ln -s /opt/elixir-x.y.z/bin/elixir /usr/local/bin/Verify the installation by running the following command:
elixir --versionYou should see the version number of Elixir printed on the terminal.
On the other hand, if you want to install Elixir from source code, follow the steps given below:
Clone the Elixir source code repository using the following command:
git clone https://github.com/elixir-lang/elixir.gitNavigate to the Elixir directory:
cd elixirCompile the Elixir source code using the following command:
make clean testInstall Elixir by running the following command:
sudo make installVerify the installation by running the following command:
elixir --versionYou should see the version number of Elixir printed on the terminal.
Conclusion
By following either of the above methods, you have successfully installed Elixir on Elementary OS latest. You can now use Elixir to develop scalable and fault-tolerant applications.