Step 1. Installing all required libraries for ubuntu :
sudo apt-get install \
libbsd-dev \
libedit-dev \
libevent-core-2.0-5 \
libevent-dev \
libevent-extra-2.0-5 \
libevent-openssl-2.0-5 \
libevent-pthreads-2.0-5 \
libgmp-dev \
libgmpxx4ldbl \
libssl-dev \
libxml2-dev \
libyaml-dev \
libreadline-dev \
automake \
libtool \
git \
llvm \
libpcre3-dev \
libgc-dev \
zlib1g-dev \
build-essential -y
Step 2: Adding the Crystal Repository Before installing any packages on the Ubuntu server instance, it is recommended to update the system. Log in using the sudo user and run the following commands to update the system. Automatically :
curl https://dist.crystal-lang.org/apt/setup.sh | sudo bash
Manually :
apt-key adv --keyserver keys.gnupg.net --recv-keys 09617FD37CC06B54
echo "deb https://dist.crystal-lang.org/apt crystal main" > /etc/apt/sources.list.d/crystal.list
apt-get update
Step 3: Installing Crystal After the repository is added, then we can now install crystal directly by :
sudo apt-get install crystal