Created
March 17, 2025 17:19
-
-
Save filipeandre/c94cae9e8afb7716da30b490ea688262 to your computer and use it in GitHub Desktop.
Install pgbadger on Amazon Linux 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Updating package lists..." | |
dnf update -y | |
echo "Installing required dependencies..." | |
dnf install -y perl perl-core perl-FindBin perl-Time-HiRes perl-JSON \ | |
perl-Digest-MD5 perl-Text-CSV perl-LWP-Protocol-https \ | |
perl-DBI perl-DBD-Pg tar gzip make | |
echo "Setting locale to avoid warnings..." | |
export LC_ALL="en_US.UTF-8" | |
export LANG="en_US.UTF-8" | |
echo "Downloading latest pgbadger source..." | |
cd /usr/local/src | |
curl -LO https://github.com/darold/pgbadger/archive/refs/tags/v12.0.tar.gz | |
echo "Extracting pgbadger..." | |
tar xzf v12.0.tar.gz | |
cd pgbadger-12.0 | |
echo "Compiling pgbadger..." | |
perl Makefile.PL | |
make | |
make install | |
dnf install -y glibc-langpack-en | |
localedef -i en_US -f UTF-8 en_US.UTF-8 | |
# Verify installation | |
if command -v pgbadger &> /dev/null; then | |
echo "✅ pgbadger installed successfully!" | |
pgbadger --version | |
else | |
echo "❌ Installation failed! Please check the logs." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment