# Postgresql install errors on Ubuntu 16.04

**URL:** <https://meta.discourse.org/t/postgresql-install-errors-on-ubuntu-16-04/70846>\
**Category:** Development\
**Created:** [2017 年 9 月 27 日午前 3:13 UTC](https://meta.discourse.org/t/postgresql-install-errors-on-ubuntu-16-04/70846 "2017-09-27T03:13:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Phlegz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/phlegz/32/80119_2.png) [@Phlegz](https://meta.discourse.org/u/Phlegz)\
**Post date:** [2017 年 10 月 8 日午前 12:26 UTC](https://meta.discourse.org/t/postgresql-install-errors-on-ubuntu-16-04/70846/2 "2017-10-08T00:26:53Z")

</div>

> [@j127](#):
>
> createuser --createdb --superuser -Upostgres $(cat /tmp/username)

I was getting the same error but I realized my problem was that I initially had a role with my username so what I needed to do was to drop that role in postgres and then follow the steps again:

# Postgresql  
sudo -u postgres -i  
createuser --superuser -Upostgres $(cat /tmp/username)  
psql -c “ALTER USER $(cat /tmp/username) WITH PASSWORD ‘password’;”  
exit

---

_[View the full topic](https://meta.discourse.org/t/postgresql-install-errors-on-ubuntu-16-04/70846)._
