Skip to content

Installation

Prerequisites

  • Bash 4.0+ (available on all modern systems)
  • PostgreSQL client tools (psql, pg_dump, etc.)
  • GNU getopt (usually pre-installed)
  • make (for installation)

Installation Methods

RPM packages (Fedora/RHEL/CentOS/AlmaLinux/Rocky):

# Download and install
curl -L "https://gitlab.com/l_avrot/pg-lord-of-the-rings/-/packages/generic/pglord/v1.1/pglord-1.1-1.fc41.noarch.rpm" -o pglord.rpm
sudo dnf install ./pglord.rpm

# Or with yum
sudo yum install ./pglord.rpm

DEB packages (Debian/Ubuntu):

# Download and install
curl -L "https://gitlab.com/l_avrot/pg-lord-of-the-rings/-/packages/generic/pglord/v1.1/pglord_1.1-1_all.deb" -o pglord.deb
sudo dpkg -i pglord.deb

Package installation puts files in:

Script: `/usr/bin/pg`
Manual: `/usr/share/man/man1/pg.1`

Method 2: From Source

# Clone repository
git clone https://gitlab.com/l_avrot/pg-lord-of-the-rings.git
cd pg-lord-of-the-rings

# Install system-wide (requires sudo)
sudo make install

# OR install for current user only
make install PREFIX=$HOME/.local

System-wide installation puts files in: - Script: /usr/local/bin/pg - Manual: /usr/local/share/man/man1/pg.1

Local installation puts files in: - Script: $HOME/.local/bin/pg - Manual: $HOME/.local/share/man/man1/pg.1

Local Installation

For local installation, ensure $HOME/.local/bin is in your PATH:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Verification

Test your installation:

# Check pg is available
which pg
pg version

# Verify manual page
man pg

# Test connection (adjust for your setup)
pg info ready # or pg ready

# Or use the built-in check
make check  # (if still in source directory)

Uninstallation

To remove pg:

# If installed system-wide
sudo make uninstall

# If installed locally
make uninstall PREFIX=$HOME/.local

Next Steps