How To Install PostgreSQL 10 on Linux Mint 18.3
To Install PostgreSQL 10 on Linux Mint 18.3
The PostgreSQL Development Team has announced the latest version PostgreSQL 10. PostgreSQL is an open source object-relational database system. It is one of leading database server used for production servers. PostgreSQL allows us to execute stored procedures in various programming languages, like C/C++, Python, Java, Perl, Ruby and its own PL/pgSQL, which is similar to Oracle’ s PL/SQL. The method to install PostgreSQL on Linux Mint 18.3 is covered in this tutorial.
Installing PostgreSQL
First create a file at source list /etc/apt/sources.list.d/postgresql.list.
linuxhelp ~ # sh -c ' echo " deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list' Import repository key: linuxhelp ~ # wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - OK
And then update the system repository.
linuxhelp ~ # apt-get update
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Ign:3 http://packages.linuxmint.com sylvia InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://packages.linuxmint.com sylvia Release [24.2 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:7 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease [46.4 kB
.
.
Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [592 kB]
Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [547 kB]
Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [239 kB]
Fetched 5,464 kB in 11s (464 kB/s)
Reading package lists... Done
Now we have to Install PostgreSQL 10
linuxhelp ~ # apt-get install postgresql-10
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpq5 pgdg-keyring postgresql-client-10 postgresql-client-common postgresql-common
Suggested packages:
locales-all postgresql-doc-10 libjson-perl
Recommended packages:
sysstat
The following NEW packages will be installed:
libpq5 pgdg-keyring postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common
.
.
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
update-alternatives: using /usr/share/postgresql/10/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Next, we have to change postgres user password by login to postgres user.
linuxhelp ~ # su &ndash postgres
Now get into psql database using the following command.
postgres@linuxhelp ~ $ psql psql (10.2 (Ubuntu 10.2-1.pgdg16.04+1)) Type " help" for help. postgres=# Run the following command to alter password postgres=# ALTER USER postgres WITH PASSWORD ' somepassword' ALTER ROLE replace the ‘ somepassword’ with your preferred password and then exit postgres=# q postgres@linuxhelp ~ $ exit logout
Now let' s try installing postgresql GUI client &ndash pgadmin3 by running the following command.
linuxhelp ~ # apt-get install pgadmin3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libjs-jquery libjs-underscore libwxbase3.0-0v5 libwxgtk3.0-0v5 pgadmin3-data
Suggested packages:
javascript-common postgresql-contrib
Recommended packages:
javascript-common pgagent
The following NEW packages will be installed:
.
.
Setting up libjs-underscore (1.7.0~dfsg-1ubuntu1) ...
Setting up libwxbase3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...
Setting up libwxgtk3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...
Setting up pgadmin3-data (1.22.2-4.pgdg16.04+1) ...
Setting up pgadmin3 (1.22.2-4.pgdg16.04+1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Now the PostgreSQL installation along with pgadmin3 has been completely installed. with this, the method to install Postgresql 10 on Linux Mint 18.3 comes to an end