Install Julia Programming Language on CentOS | RHEL 9

In this guide we’ll explore installation of Julia Programming Language on CentOS | RHEL 9 systems. Julia is dynamically typed, general-purpose programming language with a clean syntax created for numerical analysis, computational science, and even use in general scripting and web development.

Julia has a powerful set of features, very friendly syntax, and programs written in Julia executes very fast. This programming language integrates well with open-source libraries for analysis, data wrangling, and visualization. The community around it is growing drastically.

Recommended books: Best books to Learn Julia Programming.

Install Julia Programming Language on CentOS | RHEL 9

The Julia programming language can be installed on your CentOS 9 or RHEL 9 either using either of the following methods:

  • Automated using juliaup
  • Manually using release tarball

Install Julia Using Juliaup

The suggested method of installing the Julia programming language is to use a tool called juliaup. This is a small standalone binary that has been created for this specific task. When you use juliaup, it will download and install the current stable release of the Julia binary for you. In addition, it will help you keep that installation up to date. Another benefit to using juliaup is that it allows for the installation and use of multiple versions of Julia simultaneously, which provides more flexibility for your development environment.

Install curl if you don’t have it installed yet:

sudo dnf install curl 

Then install juliaup by running this in your terminal:

curl -fsSL https://install.julialang.org | sh

Sample output:

info: downloading installer
Welcome to Julia!

This will download and install the official Julia Language distribution
and its version manager Juliaup.

Juliaup will be installed into the Juliaup home directory, located at:

  /home/cloudspinx/.juliaup

The julia, juliaup and other commands will be added to
Juliaup's bin directory, located at:

  /home/cloudspinx/.juliaup/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /home/cloudspinx/.bashrc
  /home/cloudspinx/.profile

Julia will look for a new version of Juliaup itself every 1440 minutes when you start julia.

You can uninstall at any time with juliaup self uninstall and these
changes will be reverted.

✔ Do you want to install with these default configuration choices? · Proceed with installation

Now installing Juliaup
Checking for new Julia versions
Installing Julia 1.11.5+0.x64.linux.gnu
Configured the default Julia version to be 'release'.
Julia was successfully installed on your system.

Depending on which shell you are using, run one of the following
commands to reload the PATH environment variable:

  . /home/cloudspinx/.bashrc
  . /home/cloudspinx/.profile

This will install the latest stable version of Julia, which can be launched from a command-line by typing julia as well as the juliaup tool.

cloudspinx@CentOS-9:~$ julia --version
julia version 1.11.5

Launch Julia shell using the command below:

julia

Install Julia Manually Using tarball

Binary packages of Julia are available for easy installation on any Linux system. I recommend you visit  Julia Linux Binaries page to check the latest release before downloading. Let’s now start to install Julia on Linux Systems.

If you don’t have wget or tar install it.

sudo yum update
sudo yum install wget tar -y

With wget installed use it to pull the latest release of Julia binary package.

## LTS Version
wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.9-linux-x86_64.tar.gz

## Current Stable Version
wget https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.5-linux-x86_64.tar.gz

Extract the file downloaded using tar command line tool.

tar xvf julia-*-linux-x86_64.tar.gz

Move the folder that was created from extractions to the /opt directory.

sudo mv julia-1.11.5 /opt/julia

Add /opt/julia/bin directory to your PATH.

# For Bash
$ vim ~/.bashrc
export PATH=$PATH:/opt/julia/bin

# For Zsh
$ vim ~/.zshrc
export PATH=$PATH:/opt/julia/bin

Source the bashrc file to update the settings. If you’re using zshrc the file to be modified should be ~/.zshrc

$ source ~/.bashrc
# Or for Zsh
$ source ~/.zshrc

Validate your current PATH settings.

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/julia/bin

Confirm julia binary file is executable from your shell terminal session.

julia --version

Start Julia shell using julia and run hello world:

Let’s print Hello World message on the terminal.

julia> println("hello world")
hello world

Julia programs should end with extension .jl. I’ll create a new function file called myfuctions.jl.

vim myfuctions.jl

The file have below contents.

# [function](https://docs.julialang.org/en/v1/manual/functions/#man-functions-1) to calculate the volume of a sphere
function sphere_vol(r)
    # julia allows [Unicode names](https://docs.julialang.org/en/v1/manual/unicode-input/#Unicode-Input-1) (in UTF-8 encoding)
    # so either "pi" or the symbol π can be used
    return 4/3*pi*r^3
end

# functions can also be defined more succinctly
quadratic(a, sqr_term, b) = (-b + sqr_term) / 2a

# calculates x for 0 = a*x^2+b*x+c, [arguments types](https://docs.julialang.org/en/v1/manual/functions/#Further-Reading-1) can be defined in function definitions
function quadratic2(a::Float64, b::Float64, c::Float64)
    # unlike other languages 2a is equivalent to 2*a
    # a^2 is used instead of a**2 or pow(a,2)
    sqr_term = sqrt(b^2-4a*c)
    r1 = quadratic(a, sqr_term, b)
    r2 = quadratic(a, -sqr_term, b)
    # multiple values can be returned from a function using tuples
    # if the [return](https://docs.julialang.org/en/v1/manual/functions/#The-return-Keyword-1) keyword is omitted, the last term is returned
    r1, r2
end

vol = sphere_vol(3)
# @printf allows number formatting but does not automatically append the \n to statements, see below
using Printf
@printf "volume = %0.3f\n" vol 
#> volume = 113.097

quad1, quad2 = quadratic2(2.0, -2.0, -12.0)
println("result 1: ", quad1)
#> result 1: 3.0
println("result 2: ", quad2)
#> result 2: -2.0

Then run the file on command prompt or terminal with the command:

We hope this guide helped you to install Julia on Linux. For more examples go through the Julia samples page which captures standard concepts to get you started.

Also check:

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

PHP 8.4 is available for production use with lots of new features, improvements and deprecated ones as well. In this […]

Adobe Illustrator is a popular vector illustration application that one can use to capture their creative ideas. Designers use it […]

In today’s guide we will walk you through the steps to install Kotlin Programming Language on Linux Mint | Ubuntu. […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.