Install dependencies
GCC, Cmake, PCRE, Zlib and OpenSSL are required to be installed.
MySQL, PostgreSQL, Redis are optional.
Start by updating the package list:
sudo apt update
GCC
Install the build-essential package by typing:
sudo apt install build-essential
The command installs many new packages, including gcc
, g++
and make
To verify that the GCC compiler has been successfully installed, use the gcc --version command, which displays the GCC version.
gcc --version
GCC is now installed on your system and you can start using it.
Cmake
Package Manager
Installing cmake from the official repositories is done with the command:
sudo apt install cmake
Build from source files
Download the archive from the official site:
wget https://github.com/Kitware/CMake/releases/download/v3.27.0-rc3/cmake-3.27.0-rc3.tar.gz
Unpack:
tar -zxvf cmake-3.27.0-rc3.tar.gz
Change to the unpacked directory:
cd cmake-3.27.0-rc3
Start the build process
./bootstrap
Start the installation process
make
Copy the compiled files to the appropriate locations
make install
PCRE
Installing pcre from the official repositories is done with the command:
sudo apt install libpcre3-dev
Zlib
Package Manager
Installing zlib from the official repositories is done with the command:
sudo apt install zlib1g-dev
Building from source files
Download the archive from the official site:
wget https://zlib.net/zlib-1.2.13.tar.gz
Unpack:
tar -zxvf zlib-1.2.13.tar.gz
Change to the unpacked directory:
cd zlib-1.2.13
Start the build process
./configure
Start the installation process
make
Copy the compiled files to the appropriate locations
make install
OpenSSL
Installing openssl from the official repositories is done with the command:
sudo apt install openssl libssl-dev
MySQL
sudo apt install mysql-server
Detailed instructions are available on DigitalOcean
PostgreSQL
sudo apt install postgresql postgresql-contrib
Detailed instructions are available on DigitalOcean
Redis
Add the repository to the apt index:
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
Then install:
sudo apt-get install redis
Detailed instructions are available on Redis