Open pg_hba.conf, and insert/change the line from:

local              all             postgres          md5

To:

local              all              postgres         trust

Then:

sudo service postgresql reload

Login to psql:

psql -U postgres

Then:

ALTER USER postgres PASSWORD ‘new-password’;

Quit: \q

Change back pg_hba.conf. And reload postresql service.