$ cat /etc/os-release
PRETTY_NAME=”Ubuntu 22.04.3 LTS”
$ psql –version
bash: psql: command not found
### インストール
$ sudo apt install postgresql postgresql-contrib
$ psql –version
psql (PostgreSQL) 14.15 (Ubuntu 14.15-0ubuntu0.22.04.1)
### アンインストール
$ dpkg -l | grep postgres
ii postgresql 14+238 all object-relational SQL database (supported version)
ii postgresql-14
…
$ sudo apt remove –purge postgresql
$ sudo apt remove –purge postgresql-14
$ sudo apt remove –purge postgresql-client-14
$ sudo apt remove –purge postgresql-client-common
$ sudo apt remove –purge postgresql-common
$ sudo apt remove –purge postgresql-contrib
$ dpkg -l | grep postgres
$ psql –version
bash: /usr/bin/psql: No such file or directory