Cyberithub

How to Install Racket Programming Language on Ubuntu 20.04 LTS

Advertisements

In this article, I will take you through the steps to install racket programming language on Ubuntu 20.04 LTS but before that let me ask you a quick question. Do you know which is the first language to support higher-order software contracts and safe gradual typing ? If your answer is Racket Programming Language then you are absolutely correct. It allows programmers to deploy these tools to harden their software. Not only this, Racket also allows developers to define their own loops with powerful macros. These macros are so powerful that programmers make entire domain-specific languages as libraries. No tools, no Makefiles required.

It includes a rich set of libraries, covering the full range from web server apps to mathematics and scientific simulation software. It has plenty of other features as well which makes it a easy choice for Developers and Programmers. We will the steps to install racket programming language on Ubuntu 20.04 LTS in great detail in below section. More on Racket Documentation.

How to Install Racket Programming Language on Ubuntu 20.04 LTS

How to Install Racket programming language on Ubuntu 20.04 LTS

Also Read: How to Install and Use Chapel Programming Language on Ubuntu 20.04 LTS

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS System.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility installed in the Server.

 

Step 2: Update Your Server

It is always recommended to check if there are any new versions of your installed packages are available to download and install using apt update or apt-get update command. This will make sure all the installed packages from all the repositories are up to date.

root@localhost:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 https://apt.releases.hashicorp.com focal InRelease
Hit:5 https://packages.microsoft.com/repos/edge stable InRelease
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:7 http://ppa.launchpad.net/ansible/ansible/ubuntu focal InRelease
Hit:8 https://packages.grafana.com/oss/deb stable InRelease
Hit:9 http://ppa.launchpad.net/micahflee/ppa/ubuntu focal InRelease
Hit:10 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
Get:11 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [29.0 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [63.6 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]

 

Step 3: Install Racket 

Next step is to install Racket Programming Language using apt-get install racket -y command as shown below. This will download and install racket package along with its dependencies.

root@localhost:~# apt-get install racket -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
racket-common racket-doc
Recommended packages:
libjpeg62-turbo
The following NEW packages will be installed:
racket racket-common racket-doc
0 upgraded, 3 newly installed, 0 to remove and 8 not upgraded.
Need to get 79.2 MB of archives.
After this operation, 489 MB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 racket-common all 7.2+dfsg1-2ubuntu3 [44.4 MB]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 racket amd64 7.2+dfsg1-2ubuntu3 [1,937 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 racket-doc all 7.2+dfsg1-2ubuntu3 [32.9 MB]
Fetched 79.2 MB in 6s (14.0 MB/s)
Selecting previously unselected package racket-common.
(Reading database ... 238286 files and directories currently installed.)
Preparing to unpack .../racket-common_7.2+dfsg1-2ubuntu3_all.deb ...

 

Step 4: Check Racket Version

Once installed successfully, you can check its version by using racket --version command. As you can see the current installed version is 7.2.

root@localhost:~# racket --version
Welcome to Racket v7.2.

 

Step 5: Running Your First Program

Once Racket is installed and verified, it is now time to write a sample program. You can run drracket command to open the Graphical IDE as you can see below.

How to Install Racket Programming Language on Ubuntu 20.04 LTS 2

Here you have choose your Language first. So you need to Click on Language and then select The Racket Language as shown below.

How to Install Racket Programming Language on Ubuntu 20.04 LTS 3

Once selected, now you can write your first program. Here we are displaying Hi, This is from CyberITHub on the output using below program. So you just need to write your program and Click on Run to shown the output on below window.

How to Install Racket Programming Language on Ubuntu 20.04 LTS 4

 

Step 6: Uninstall Racket

Once you are done using Racket Programming Language, then you can also remove it by using apt-get remove racket -y command as shown below.

root@localhost:~# apt-get remove racket -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
racket-common racket-doc
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
racket
0 upgraded, 0 newly installed, 1 to remove and 8 not upgraded.
After this operation, 14.5 MB disk space will be freed.
(Reading database ... 262144 files and directories currently installed.)
Removing racket (7.2+dfsg1-2ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

Leave a Comment