2

I am able to uninstall postgresql from Ubuntu. But I cannot seem remove the client - psql.

I've tried the steps listed here: How to remove Postgres from my installation?. But it still doesn't work

6
  • What are the exact error messages that you get?
    – Jos
    Jul 16, 2019 at 13:45
  • 1
    what does sudo apt purge psql* return?
    – tatsu
    Jul 16, 2019 at 13:45
  • no error message. the psql CLI just still works fine.
    – Zach Smith
    Jul 16, 2019 at 13:45
  • Thank you @tatsu - that worked
    – Zach Smith
    Jul 16, 2019 at 13:46
  • 1
    I'm aware @tatsu - there is a minimum time limit
    – Zach Smith
    Jul 16, 2019 at 14:06

1 Answer 1

3

the command you are looking for is :

sudo apt purge postgresql-client-common

purge is different from remove as it will also remove the dependencies that only this app uses.

5
  • Thank you. what does this purge command do that uninstall doesn't?
    – Zach Smith
    Jul 16, 2019 at 13:50
  • psql* is not the proper string to purge on.
    – Thomas Ward
    Jul 16, 2019 at 14:05
  • but if I put the exact package then you don't need purge either. purge can be really handy when you are in a scenario where don't want any of the app left on your system and you don't know what package name you are looking for. in this case it worked for him, I assume, because postgresql-client-common was one of the dependencies pulled when installing psql.
    – tatsu
    Jul 16, 2019 at 14:45
  • I've been looking for this for years! I had a postgres installation on my macbook that was interfering with a docker container running postgres on the default port 5432, and I never figured out how to remove the local postgres install, so in that fleet of containers I had to use a docker-compose.override.yml file to remap the ports to avoid the conflict... a similar problem just came up (but not the same - I wanted to remove pg latest and install an earlier version for some testing), and I found this - thank you!
    – drkvogel
    Feb 25, 2022 at 14:39
  • What I wonder, though, is why is it not obvious how to uninstall pg, why is this command not on the pg website (AFAIK), why does apt-get --purge remove postgresql not work, and why are there only 3 upvotes for this answer??
    – drkvogel
    Feb 25, 2022 at 14:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .