Uninstall PostgreSQL 17 client on Linux
Table of Contents
1. Uninstall PostgreSQL 17 client
[root@client01 ~]# dnf remove -y postgresql17
Dependencies resolved.
=================================================================================================
Package Architecture Version Repository Size
=================================================================================================
Removing:
postgresql17 x86_64 17.10-2PGDG.rhel9.8 @pgdg17 11 M
Removing unused dependencies:
postgresql17-libs x86_64 17.10-2PGDG.rhel9.8 @pgdg17 1.2 M
Transaction Summary
=================================================================================================
Remove 2 Packages
Freed space: 12 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : postgresql17-17.10-2PGDG.rhel9.8.x86_64 1/2
Running scriptlet: postgresql17-17.10-2PGDG.rhel9.8.x86_64 1/2
Erasing : postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64 2/2
Running scriptlet: postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64 2/2
Verifying : postgresql17-17.10-2PGDG.rhel9.8.x86_64 1/2
Verifying : postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64 2/2
Removed:
postgresql17-17.10-2PGDG.rhel9.8.x86_64 postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64
Complete!
[root@client01 ~]#
2. Remove the official PostgreSQL (PGDG) repository
[root@client01 ~]# dnf remove pgdg-redhat-repo -y
Dependencies resolved.
=================================================================================================================================
Package Architecture Version Repository Size
=================================================================================================================================
Removing:
pgdg-redhat-repo noarch 42.0-64.rhel9PGDG @@commandline 16 k
Transaction Summary
=================================================================================================================================
Remove 1 Package
Freed space: 16 k
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch 1/1
Verifying : pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch 1/1
Removed:
pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch
Complete!
[root@client01 ~]#
3. Verify the installation
[root@client01 ~]# psql --version
-bash: /usr/bin/psql: No such file or directory
[root@client01 ~]#
Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.
Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/