How to Install Julia on Linux

Julia is an open-source programming language that is used in the field of scientific computing. It is high-performance, dynamically typed, simple to write, and has an abundance of scientific packages which makes it perfect for data analysts, scientists, and for anyone trying to manipulate a bunch of data efficiently. According to the Stack Overflow 2022 Developer Survey, Julia is the fourth most loved language among developers.

In this article, we will go over how to install and set up Julia on Linux.

Installing Julia on Linux

The official way to install Julia is using the pre-compiled binaries they offer on their website. You can also download it from the Snap Store or from the Ubuntu repository (using apt install), however, there is no guarantee that it will be the latest version.

Installing Julia using pre-compiled binaries (recommended)

To download the pre-compiled binaries, go to the Julia website and download the preferred version. You can either download the current stable release (recommended for almost everyone unless you know what you are doing) , the long-term support release, or an upcoming beta release.

Julia Stable Download 1
Julia Stable Download
  • NOTE : Unless you are using an offbeat distro like Void Linux which has musl; get the 64-bit(glibc) version.

After downloading it, navigate to the directory in which the tar file is stored (usually the Downloads folder) and extract the file using the following command :

tar -xvzf /path/to/tar/file

This is how it looks for the 1.8.5 version.

Julia Install
Julia Install

To work with Julia, navigate to the folder in which the files were extracted to, go to bin and execute ./julia like shown below.

Starting Julia
Starting Julia

However it is a better idea to add a link to the Julia binary in the local binaries directory, so you don’t have to navigate to Downloads every time you have to work with Julia.

To do that run the following,

sudo ln -s <path/to/binary/file> /usr/local/bin/julia

This command will make an executable file in /usr/local/bin named Julia and link it to the executable that you have in the extracted folder. Now you can simply use Julia by executing julia in the terminal regardless of which directory you are in.

Adding Julia To Path
Adding Julia To Path

Installing Julia using snap

Installing Julia using Snap is a convenient method to get the latest version of Julia on your system. Here are the steps to install Julia using snap:

Verify that Snap is installed on your system:

  • Open a terminal window
  • Type the command snap version and press enter
  • If snap is installed, you will see the version of Snap and other information about your installation

Install Julia using snap:

  • Open a terminal window
  • Type the command sudo snap install julia --classic and press enter
  • This command will download and install the latest version of Julia on your system
  • You may be prompted to enter your password, enter it and press enter
  • Snap will take care of downloading and installing Julia, this process may take a few minutes depending on your internet connection

If you are having any difficulties with installing, setting up or understanding Snap, please refer to : Snaps in Linux: A Basic Introduction

Using Julia

There are two ways to use Julia. You can use the Julia in the interactive mode by simply executing it in the terminal. You can also write your code in a .jl file and run it using the following command

julia /path/to/script.jl

Both of the methods are shown below.

Julia Working
Julia Working

Conclusion

In this article, we learned how to install and setup Julia, which is a high performance language made for scientific computing. As data science and machine learning become more commonplace in academia, the popularity of Julia is just going to rise. You can learn about Julia in depth by following their official documentation. One of the language which rivals Julia is R. To learn more about R, check out this article. Happy coding!

How can I install Julia Programming Language on Ubuntu 20.04?

You can follow this step-by-step tutorial to install Julia on Ubuntu 20.04.

Is Julia a popular language for cloud applications?

Yes, Julia is known for its fast computation and is popular in cloud applications.

Where can I find the official download page for Julia?

You can download Julia from the official download page on the Julia website.

Can I run Julia REPL after installing it on Ubuntu?

Yes, you can run Julia REPL (Read-Eval-Print Loop) to interactively work with Julia language.

How can I update Julia on my Ubuntu machine?

You can update Julia by following the instructions provided on the official Julia website.

What is the recommended way to add Julia to my home directory?

It is recommended to add Julia to your home directory to ensure easy access and use.