Installing Julia on Ubuntu

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

DSB
Coffee in a Klein Bottle
2 min readOct 2, 2020

--

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.6.4.

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.6.4-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.6.4/ /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.6.4/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 PkgPkg.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. For some reason, if the kernel is not installed, you can just run:

using IJuliainstallkernel("Julia")

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

--

--