# 1. prepare the destination directory
sudo mkdir /usr/local/pgsql
sudo chmod 775 /usr/local/pgsql
sudo chown $(whoami) /usr/local/pgsql
# 2. initialize postgres daemon. By setting $PGDATA to `/usr/local/pgsql' the -D option is not needed
pg_ctl start -D /usr/local/pgsql
# 2.1 If the initializer failed to create the {$user} database, run:
createdb
# 3. Start psql
psql
# 4. stop the daemon
pg_ctl stop -D /usr/local/pgsql
kubectl config current-context
Sometimes when running a docker image one is not sure which distro it's running on, for that:
cat /etc/*-release