How to Install julia on Ubuntu 16.04
Posted on September 30, 2017 (Last modified on July 14, 2022) • 2 min read • 382 wordsIn this tutorial we'll learn how to install Julia Language on Ubuntu 16.04. We will learn to install Julia from Ubuntu repository and latest version of Julia by downloading binary from Julia website.
In this tutorial we’ll learn how to install Julia on Ubuntu 16.04 (Xenial Xerus).
Julia is a high-level, high-performance dynamic programming language for numerical computing. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy and an extensive mathematical function library.
Several features of Julia
Julia is available from Ubuntu 16.04 repository. To install Julia we can run commands below
Update apt database using the command below
sudo apt-get update
Install Julia using the command below
sudo apt-get install julia
Julia and its dependencies will be installed. Press Y to continue.
Now we can run Julia interactive by running julia
.
To print simple Hello world on Julia we can use println function from Julia interactive.
julia> println("Hello Julia! - howtodojo.com")
Hello Julia! - howtodojo.com
Now Julia is ready to be used but the current installed version is not the latest stable version of Julia. As you can see above Julia version shipped in Ubuntu repository is version 0.4.5 while at the time of this writing, the latest stable version of Julia is version 0.6.1. If you want or need to use latest version of Julia you can continue reading the next section.
In this section we’ll learn how to install latest version of Julia on Ubuntu 16.04.
To get latest version of Julia we can go to Julia download page.
Let’s download Julia binary for Linux 64 bit
wget -c https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.1-linux-x86_64.tar.gz
Extract the downloaded package.
tar xzf julia-0.6.1-linux-x86_64.tar.gz
Rename extracted folder as julia
mv julia-0d7248e2ff julia
Move julia directory to /opt
sudo mv julia /opt
open .profile
on home directory.
find line
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
replace with
PATH="$HOME/bin:$HOME/.local/bin:/opt/julia/bin:$PATH"
You can relogin so that .profile
will be re-read by shell or you can run command below
source ~/.profile
In this tutorial we learned how to install Julia programming language Ubuntu 16.04 from Ubuntu repository and also how to install the latest stable version of Julia by downloading binary from Julia website.