Installing multiple versions of Julia on Ubuntu can be a bit tricky, especially when you already have a different version installed. In this article, we will explore three different ways to install Julia v0.5 on Ubuntu 16.04 while v0.6 is already installed.
Option 1: Using the Official Julia PPA
The easiest way to install Julia v0.5 alongside v0.6 is by using the Official Julia PPA. Follow the steps below:
sudo add-apt-repository ppa:staticfloat/juliareleases
sudo apt-get update
sudo apt-get install julia-0.5
This will add the Official Julia PPA to your system, update the package list, and install Julia v0.5. You can then run Julia v0.5 by typing julia-0.5
in the terminal.
Option 2: Building Julia from Source
If you prefer to build Julia from source, you can follow these steps:
sudo apt-get install build-essential
sudo apt-get install git
git clone https://github.com/JuliaLang/julia.git
cd julia
git checkout v0.5.0
make
sudo make install
This will install the necessary dependencies, clone the Julia repository, switch to the v0.5.0 tag, build Julia, and install it on your system. You can then run Julia v0.5 by typing julia
in the terminal.
Option 3: Using Julia Version Manager (juliaup)
If you prefer a more flexible approach, you can use the Julia Version Manager (juliaup) to manage multiple Julia versions. Follow these steps:
curl https://julialang.org/juliaup/juliaup-init.sh | bash
source ~/.juliaup/environments.jl
juliaup install 0.5.0
This will install juliaup, initialize the environment, and install Julia v0.5. You can then run Julia v0.5 by typing juliaup use 0.5.0
in the terminal.
After exploring these three options, it is clear that using the Official Julia PPA (Option 1) is the easiest and most straightforward method to install Julia v0.5 alongside v0.6 on Ubuntu 16.04. It requires fewer steps and ensures that the installation is managed by the package manager, making it easier to update or remove the version in the future.