DEV Community

hammadsaleemm
hammadsaleemm

Posted on

HOW TO ISTALL APACHE AGE AND PSQL FROM SOURCE ON YOUR MACHINE

Are you looking to install Apache AGE and PostgreSQL from source on your Linux machine? Well, you've come to the right place. In this article, we will be breaking down the installation process into three parts to help make it easier for you to follow along. Before we begin, please note that this guide is intended for Linux users.

Part 1: Making Directories and Installing Dependencies

The first step is to create some directories to save and install AGE and PostgreSQL. Here's how you can do it:

mkdir age_installation
cd age_installation
mkdir pg
cd pg
Enter fullscreen mode Exit fullscreen mode

Once you've created the directories, you need to install some dependencies. Here's the command to install them:

sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

Enter fullscreen mode Exit fullscreen mode

You can also install the PostgreSQL dev server with the following command:

sudo apt install postgresql-server-dev-11
Enter fullscreen mode Exit fullscreen mode

To read more about this please visit this.

Part 2: Installing PostgreSQL and AGE from Source

In this part, we will be installing PostgreSQL and AGE one by one. Let's start with PostgreSQL.

PostgreSQL

First, you need to install the version of PostgreSQL that is compatible with AGE. For this guide, we will be using version 11.8. To download and extract it, use the following command:

wget https://ftp.postgresql.org/pub/source/v11.18/postgresql-11.18.tar.gz && tar -xvf postgresql-11.18.tar.gz && rm -f postgresql-11.18.tar.gz

Enter fullscreen mode Exit fullscreen mode

Once the download is complete, you need to install PostgreSQL. Use the following commands:

cd postgresql-11.18

# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

# now install
make install

# go back
cd ../../
Enter fullscreen mode Exit fullscreen mode

You can choose to install PostgreSQL in a different path, but for this guide, we will be installing it in the same directory.

Installing AGE

After successfully installing PostgreSQL, it's time to download and install AGE. You can download AGE from the Apache AGE GitHub repository using the following command:

git clone https://github.com/apache/age.git

Enter fullscreen mode Exit fullscreen mode

To install AGE, use the following commands:

cd age/

# install
sudo make PG_CONFIG=/home/hammad/age_installation/pg/postgresql-11.18/bin/pg_config install

# install check
make PG_CONFIG=/home/hammad/age_installation/pg/postgresql-11.18/bin/pg_config installcheck
Enter fullscreen mode Exit fullscreen mode

Conclusion

That's it! You have successfully installed Apache AGE and PostgreSQL from source on your Linux machine. In the next article, we will be creating a database and initializing it. Stay tuned!

Top comments (0)