How to Install PostgreSQL 11 on Ubuntu 19.04
- 00:.39 wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- 00:46 sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
- 00:58 apt install postgresql postgresql-contrib -y
- 01:19 su – postgres
- 01:22 psql
- 01:50 ss -atulpn | grep postgres
Installation of PostgreSQL 11 on Ubuntu 19.04
Download Link :
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Installation
Run the following command to import the GPG key for PostgreSQL packages.
root@linuxhelp:~# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
OK
And then, add the repository to your system.
root@linuxhelp:~# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
Install PostgreSQL on Ubuntu.
root@linuxhelp:~# apt install postgresql postgresql-contrib -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libllvm7 libpq5 postgresql-11 postgresql-client-11 postgresql-client-common postgresql-common sysstat
Suggested packages:
postgresql-doc postgresql-doc-11 libjson-perl isag
The following NEW packages will be installed:
libllvm7 libpq5 postgresql postgresql-11 postgresql-client-11 postgresql-client-common postgresql-common
.
.
.
.
.
.
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.29-0ubuntu2) ...
After the installation of the postgresql database server, by default, it creates a user postgres and creates an account with role postgres.
root@linuxhelp:~# su – postgres
Connect to PostgreSQL 11 by triggering the following command.
%postgres@linuxhelp:~$ psql%
psql (11.3 (Ubuntu 11.3-0ubuntu0.19.04.1))
Type "help" for help.
postgres=# \conninfo
You are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5432".
postgres=# \q
Once it is done, check the listening port of PostgreSQL by executing the followong command.
postgres@linuxhelp:~$ ss -atulpn | grep postgres
tcp LISTEN 0 128 127.0.0.1:5432 0.0.0.0:* users:(("postgres",pid=35697,fd=3))
With this, the installation of PostgreSQL 11 on Ubuntu 19.04 comes to end.
Comments ( 0 )
No comments available