How To Install pg_repack on Fedora 34

pg_repack is Reorganize tables in PostgreSQL databases without any locks

Introduction

In this tutorial we learn how to install pg_repack on Fedora 34.

What is pg_repack

pg_repack is a PostgreSQL extension which lets you remove bloat from tables and indexes, and optionally restore the physical order of clustered indexes. Unlike CLUSTER and VACUUM FULL it works online, without holding an exclusive lock on the processed tables during processing. pg_repack is efficient to boot, with performance comparable to using CLUSTER directly. Please check the documentation (in the doc directory or online) for installation and usage instructions.

We can use yum or dnf to install pg_repack on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install pg_repack.

Install pg_repack on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install pg_repack using dnf by running the following command:

sudo dnf -y install pg_repack

Install pg_repack on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install pg_repack using yum by running the following command:

sudo yum -y install pg_repack

How To Uninstall pg_repack on Fedora 34

To uninstall only the pg_repack package we can use the following command:

sudo dnf remove pg_repack

pg_repack Package Contents on Fedora 34

/usr/bin/pg_repack
/usr/lib/.build-id
/usr/lib/.build-id/27
/usr/lib/.build-id/27/984ec3307d86ec0fef539766d041053b88922d
/usr/lib/.build-id/cd
/usr/lib/.build-id/cd/cda00b14e60910d00e9930e56ab39002578d45
/usr/lib64/pgsql/bitcode/pg_repack.index.bc
/usr/lib64/pgsql/bitcode/pg_repack/pgut/pgut-spi.bc
/usr/lib64/pgsql/bitcode/pg_repack/repack.bc
/usr/lib64/pgsql/pg_repack.so
/usr/share/doc/pg_repack
/usr/share/doc/pg_repack/README.rst
/usr/share/doc/pg_repack/pg_repack.html
/usr/share/doc/pg_repack/pg_repack.rst
/usr/share/doc/pg_repack/pg_repack_jp.html
/usr/share/doc/pg_repack/pg_repack_jp.rst
/usr/share/doc/pg_repack/release.html
/usr/share/doc/pg_repack/release.rst
/usr/share/licenses/pg_repack
/usr/share/licenses/pg_repack/COPYRIGHT
/usr/share/pgsql/extension/pg_repack--1.4.6.sql
/usr/share/pgsql/extension/pg_repack.control
/usr/bin/pg_repack
/usr/lib/.build-id
/usr/lib/.build-id/9b
/usr/lib/.build-id/9b/6cd30b159cc6514a74b4a3f2d8a00454c973ce
/usr/lib/.build-id/cb
/usr/lib/.build-id/cb/4c2fca70f13aa7d03b87c8a78635bdd934a8f4
/usr/lib64/pgsql/bitcode/pg_repack.index.bc
/usr/lib64/pgsql/bitcode/pg_repack/pgut/pgut-spi.bc
/usr/lib64/pgsql/bitcode/pg_repack/repack.bc
/usr/lib64/pgsql/pg_repack.so
/usr/share/doc/pg_repack
/usr/share/doc/pg_repack/README.rst
/usr/share/doc/pg_repack/pg_repack.html
/usr/share/doc/pg_repack/pg_repack.rst
/usr/share/doc/pg_repack/pg_repack_jp.html
/usr/share/doc/pg_repack/pg_repack_jp.rst
/usr/share/doc/pg_repack/release.html
/usr/share/doc/pg_repack/release.rst
/usr/share/licenses/pg_repack
/usr/share/licenses/pg_repack/COPYRIGHT
/usr/share/pgsql/extension/pg_repack--1.4.6.sql
/usr/share/pgsql/extension/pg_repack.control

References

Summary

In this tutorial we learn how to install pg_repack on Fedora 34 using yum and dnf.