Installing Julia on Ubuntu

By: DSB

Re-posted from: https://medium.com/coffee-in-a-klein-bottle/install-julia-1-5-on-ubuntu-bb8be4b2571d?source=rss-8bd6ec95ab58------2

A quick tutorial on how to install Julia on Ubuntu and add the kernel to Jupyter

Installing Julia on Ubuntu is very straightforward. As anything on Linux, there are several ways to do the installation.

1. Using Apt-Get

This is the first way, and it is the easiest. Just open the terminal and run

sudo apt-get install julia

The problem with this method is that you don’t get the latest stable version for Julia. In the time I’m writing this article, the Ubuntu repository contains the version 1.0.4 for Julia, while the current stable version is 1.5.2.

So this is not the method I recommend!

2. From the Website (recommended)

First, go to the Julia website download page. There, several ways to run Julia are shown. Go to the “Current stable release” table, and click on the link shown in the image below.

Donwload Julia by clicking on the “64-bit” inside the red square

Then, the Julia Language will be donwloaded (most likely to your Download directory). Next, go on your terminal and unzip the downloaded file.

tar -xvzf julia-1.5.2-linux-x86_64.tar.gz

You now have a folder with all the Julia files. No installation is required. Now, we move this folder to “/opt” (this is not strictly necessary, you can use any other location in your machine).

sudo mv julia-1.5.2/ /opt/

Finally, create a symbolic link to the Julia binary file. This will allow you to run the command “julia” in your terminal and start the Julia REPL.

sudo ln -s /opt/julia-1.5.2/bin/julia /usr/local/bin/julia

Done! Now Julia is already installed and working in your machine. Let’s now add it to Jupyter.

3. Adding Julia kernel to Jupyter

We assume that Jupyter is already installed in your machine. To add the Julia Kernel to it is quite easy. Just open your terminal and run “julia”. This will open the REPL, as shown in the image below.

Inside the REPL, we then run the following commands:

using Pkg
Pkg.add(“IJulia”)

The “Pkg” package is used in Julia to install different packages on Julia. By installing “IJulia”, it automatically adds the Julia kernel to Jupyter.

And that’s it. Julia should be working with your Jupyter Notebook and/or JupyterLab.


Installing Julia on Ubuntu was originally published in Coffee in a Klein Bottle on Medium, where people are continuing the conversation by highlighting and responding to this story.