skip to Main Content

I have installed Postgres on my UBUNTU VM.

prompt$ sudo -u postgres psql

and entered my linux password. I am getting the message:

could not change directory to "/home/petroman": Permission denied
psql (15.4 (Ubuntu 15.4-1.pgdg22.04+1))
Type "help" for help.
postgres=#

Can anyone help me to fix this?

I have tried reinstalling postgres, restarting the pc. I read that Ubuntu comes with a version of posgres only after I had decided to reinstall postgres. So maybe I caused a problem and caused a deletion of the original and somehow fouled up with my installation.

2

Answers


  1. psql (15.4 (Ubuntu 15.4-1.pgdg22.04+1)) Type "help" for help. postgres=# telling that you successfuly launched psql client. Don’t see any point to reinstall something, just work with databases/tables/whatever…

    If you care about permissions warning, then use sudo - -u postgres psql instead.

    Login or Signup to reply.
  2. Your /home/petroman directory does not have the correct permissions, Try chmod og+rX /home/petroman.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search