Introduction

Crystal is an exciting sounding language which is: "As slick as Ruby and as fast as C."

In this post I will show you how install the Crystal programming language on Ubuntu 2004.

Code versions used in this post

  • Ubuntu - 2004
  • Crystal - 1.1.0

Crystal Repository

First, add the Crystal repository to your apt sources.

cmd

echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
    

GPG Key

Next, add the Crystal GPG key.

cmd

curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null
    

Install

With the pre-reqs out of the way, now its time to install Crystal.

cmd

sudo apt update -y && sudo apt install crystal -y
    

Verify

Finally, verify the version of Crystal that is installed.

cmd

crystal --version

# output
Crystal 1.1.0 [af095d72d] (2021-07-14)

LLVM: 10.0.1
Default target: x86_64-unknown-linux-gnu
    

Summary

With Crystal now installed, its time to start digging into the language and eco-system.

Tags

crystal ubuntu