How to install the Julia latest stable release on Ubuntu & Linux Mint
Tags: julialang, julia, mint, ubuntu
Published: 2022-01-06 20:31:48

<script src="https://kit.fontawesome.com/fbfd53b98e.js" crossorigin="anonymous"></script>

Julia is an open-source, high-level, dynamically typed programming language.  Julia is used in data science, machine learning and scientific computing. In this tutorial, we will install the latest stable release of Julia (currently v1.7.1) and print the customary "Hello World!".
<hr>

<h1>Installation</h1>


Lets begin by opening up the terminal and enter the following commands:

*These two commands will assign the variables to get the latest stable release from JuliaLang.org.*

    JULIA_VERSION=$(curl -s "https://api.github.com/repos/JuliaLang/julia/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
    JULIA_MINOR_VERSION=$(echo $JULIA_VERSION | grep -Po "^[0-9]+.[0-9]+")

*Here we download the tar.gz file.*
    
    curl -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_MINOR_VERSION}/julia-${JULIA_VERSION}-linux-x86_64.tar.gz"


*Create the new directory for Julia.*
    
    sudo mkdir /opt/julia

*Extract our files.*
    
    sudo tar xf julia.tar.gz --strip-components=1 -C /opt/julia

*Create symbolic links.*
    
    sudo ln -s /opt/julia/bin/* /usr/local/bin

<hr>
<h2>Check It</h2>  


Now the latest version of Julia should be installed.  We can check the installation by checking the version.  

Check the version by entering the following into the terminal:

    julia -- version

You are looking for an output like this:


![Terminal example displaying the version.  In this example 1.7.1 is displayed.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dp579r6shoximasuu9sl.png)

If you don't see an output similar to the picture above, start at the top and try again.  

We don't need the tar.gz anymore.  Clean up by typing:

    rm -rf julia.tar.gz
<hr>
<h2>Test It</h2> 


Create a test file, we'll call it `main.jl`.

*In this tutorial I'm using Neovim (nvim) to edit text but you can use whatever your favorite text editor is.  Open your test file with your favorite editor:*

    `nvim main.jl`

*Edit your `main.jl` file with:*

    `println("Hello World!")`

*Save your file and exit.  From the terminal run the `julia` command:*

    `julia main.jl`

If everything installed correctly you should see 'Hello World!' in the terminal output. 

![Terminal output example displaying a 'Hello World!'](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2zyd41cojqyuh13e251w.png)
 
<hr>
<h2>Keep Learning</h2>   


Congratulations, you've made it this far! Are you ready to level up your skills? To learn more about coding with Julia check out [JuliaLang.org](https://www.JuliaLang.org). There you'll find [Julia Academy](https://juliaacademy.com/courses), [Exercism.io](https://exercism.io/tracks/julia), [YouTube](https://www.youtube.com/user/JuliaLanguage/playlists) videos and other resources available to continue your Julia journey.  

Thanks for reading!
<hr>


<h2">
Feel free to reach out!
</h2>

[![GitHub button for https://github.com/cmlohr](https://res.cloudinary.com/cmlohr/image/upload/v1641499580/-github_b7zg7w.png)](https://github.com/cmlohr)

[![Twitter button for https://twitter.com/cmlohr ](https://res.cloudinary.com/cmlohr/image/upload/v1641499580/twitter_mvly73.png)](https://twitter.com/cmlohr)

[![LinkedIn button for https://www.linkedin.com/in/cmlohr/](https://res.cloudinary.com/cmlohr/image/upload/v1641499580/-linkedin_cpm467.png)](https://www.linkedin.com/in/cmlohr/)