How To install Pg_repack In Linux
Here we are going to see step by step of pg_repack installation

What is a Pg_repack?
- Pg_repack is an extension that was created and maintained as an open-source project by several authors.
- It removes the bloat from tables and indexes and optionally restores the physical order of clustered indexes.
Pg_repack Installation steps
s-1:
To verify the OS version
[ec2-user@ip-172–31–13–65 ~]$ cat /etc/os-releases-2:
Switch as a root user and update existing packages
[root@ip-172-22-13-65 ~]# yum update -ys-3:
Wget is a free and open-source software package for getting files using HTTP, HTTPS, and FTP Internet protocols.
[root@ip-172-22-13-65 ~]# yum install wgets-4:
Switch into ec2-user and execute the below dependency libraries
- Readline-devel = Files needed to develop programs which use the readline library,
- OpenSSL= a toolkit for supporting cryptography.
sudo yum install readline-devel openssl-devels-5:
The PostgreSQL-devel package is designed for, PostgreSQL development header files and libraries.
sudo yum install postgresql-devels-6:
The GNU Compiler Collection (GCC) is a collection of compilers and libraries for C, C++, Objective-C, Fortran, Ada, Go , and D, programming languages. Many open-source projects including the GNU tools and the Linux kernel are compiled with GCC.
sudo yum install gccs-7:
Install PostgreSQL client-server rpm , we have to install the PostgreSQL package based on the PostgreSQL devel
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/postgresql-static-9.2.24-8.el7_9.x86_64.rpms-8:
Verify the downloaded package using the below command
ls -lrths-9:
Install the PostgreSQL downloaded rpm package
sudo rpm -i postgresql-static-9.2.24-7.el7_9.x86_64.rpms-10:
Download the pg_repack 1.4.5 as per the support suggestion PostgreSQL version 12 will support the pg_repack 1.4.5 only, in case if we install the pg_repack latest version 1.4.7 Due to incompatible of pg_repack version will not able to perform pg_repack
wget http://api.pgxn.org/dist/pg_repack/1.4.5/pg_repack-1.4.5.zips-11:
Unzip the downloaded the pg_repack zip file
unzip pg_repack-1.4.5.zips-12:
once we did the unzip of the pg_repack just go to that directory below
cd pg_repack-1.4.5s-13:
Execute the make command to Ensure no errors are reported.
makes-14:
To verify the pg_repack version
cd bin./pg_repack --version



