How to Install Elixir on Fedora Server
Elixir is a dynamic, functional language that runs on the Erlang virtual machine. In this tutorial, we'll go over the steps to install Elixir on Fedora Server.
Prerequisites
- A running instance of Fedora Server
- A user with sudo privileges
- Internet connectivity
Step 1 - Update the System
Before installing Elixir, ensure your Fedora Server is up to date by running the following command:
$ sudo dnf update
This command updates the system with the latest security patches and software updates.
Step 2 - Install Elixir Dependencies
To install Elixir, we'll need to install a few dependencies. Run the following command to install them:
$ sudo dnf install git gcc glibc-devel make ncurses-devel openssl-devel autoconf
Step 3 - Install Erlang
Elixir runs on the Erlang virtual machine, so we'll need to install it. Run the following command:
$ sudo dnf install erlang
Step 4 - Download and Build Elixir
We'll use Git to download the latest stable version of Elixir. Run the following command:
$ git clone https://github.com/elixir-lang/elixir.git
This command clones the Elixir repository to your current working directory.
Navigate to the newly cloned Elixir directory and compile it:
$ cd elixir
$ make clean test
$ make
The make command will compile Elixir and generate a bin directory.
Step 5 - Add Elixir to Your PATH
To use Elixir from anywhere on your system, you'll need to add it to your PATH variable. Run the following command to open your .bashrc file:
$ nano ~/.bashrc
Add the following line to the end of the file:
export PATH="$PATH:/path/to/your/elixir/bin"
Replace /path/to/your/elixir with the absolute path to your Elixir directory.
Save and close the file by pressing CTRL + X, then Y and ENTER.
To apply the changes, run the following command:
$ source ~/.bashrc
Step 6 - Verify Installation
To ensure that Elixir is correctly installed, type the following command:
$ elixir --version
This command displays the version of Elixir installed on your system.
Conclusion
In this tutorial, we went over the steps to install Elixir on Fedora Server. You should now have a working installation of Elixir that you can use for your projects.