top ad article

By the end of this article you will have learnt how to install PostgreSQL Server 13 on Deepin Linux 20.x as easy as possible. PostgreSQL Server just like MariaDB is an open source relational database management system. Having been developed around 30 year ago, it has earned some trust with many when it comes to its general performance. Below are a few of PostgreSQL Server 13 features, you can get to know more about them on the PostgreSQL page;

  • PostgreSQL Server 13 can be used on various data types
  • Customizable storage interface for tables
  • Robust access-control system
  • Indexing: B-tree, Expressions, Multicolumn, Partial

Install PostgreSQL Server 13 on Deepin Linux 20.x

On the following step by step process, you will learn how to install PostgreSQL Server 13 on Deepin Linux 20.x successfully. Lets make this installation possible by following the guide below to the end;

Step 1. Update your System

To update your Deepin Linux system and all previously installed packages, use the commands below;

sudo apt update
sudo apt upgrade -y

Step 2. Reboot Server

Once the update and upgrade is done, ensure to reboot your system too by using the command as shown below;

reboot

Step 3. Import GPG Key

A GPG Key for signing the packages is required, hence the need to import it into your system. To do so, use the commands below;

sudo apt update
sudo apt install gnupg2
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

The output is as follows;

[email protected]:~$ sudo apt -y install gnupg2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  gnupg2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 393 kB of archives.
After this operation, 411 kB of additional disk space will be used.
Get:1 https://community-packages.deepin.com/deepin apricot/main amd64 gnupg2 all 2.2.12-1+deb10u1 [393 kB]
Fetched 393 kB in 3s (117 kB/s) 
Selecting previously unselected package gnupg2.
(Reading database ... 196161 files and directories currently installed.)
Preparing to unpack .../gnupg2_2.2.12-1+deb10u1_all.deb ...
Unpacking gnupg2 (2.2.12-1+deb10u1) ...
Setting up gnupg2 (2.2.12-1+deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...

The other output is as folows;

[email protected]:~$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Password
Verification successful
OK

Step 3. Add PostgreSQL Repository to Deepin Linux

To add the PostgreSQL repository on to your Deepin Linux System, use the command as shown below;

echo "deb http://apt.postgresql.org/pub/repos/apt/ `buster-pgdg main" |sudo tee  /etc/apt/sources.list.d/pgdg.list

The output;

[email protected]:~$ echo "deb http://apt.postgresql.org/pub/repos/apt/ `buster-pgdg main" |sudo tee  /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main

Step 4: Install PostgreSQL Server 13 on Deepin Linux 20.x

Now that GPG Key has been added and the PostgreSQL repository added, you can then proceed to install PostgreSQL Server on Deeepin Linux 20.x using the command as shown below;

sudo apt update
sudo apt -y install postgresql-13 postgresql-client-13

The output is as follows;

[email protected]:~$ sudo apt install postgresql-13 postgresql-client-13
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libcommon-sense-perl libjson-perl libjson-xs-perl libllvm7 libpq5
  libtypes-serialiser-perl pgdg-keyring postgresql-client-common
  postgresql-common sysstat
Suggested packages:
  postgresql-doc-13 isag
The following NEW packages will be installed:
  libcommon-sense-perl libjson-perl libjson-xs-perl libllvm7 libpq5
  libtypes-serialiser-perl pgdg-keyring postgresql-13 postgresql-client-13
  postgresql-client-common postgresql-common sysstat
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.8 MB of archives.
After this operation, 119 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 libpq5 amd64 13.3-1.pgdg100+1 [178 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 pgdg-keyring all 2018.2 [10.7 kB]
Get:3 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-common all 226.pgdg100+1 [90.6 kB]
Get:4 https://community-packages.deepin.com/deepin apricot/main amd64 libcommon-sense-perl amd64 3.74-2+b7 [24.0 kB]
Get:5 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-13 amd64 13.3-1.pgdg100+1 [1501 kB]
Get:6 https://community-packages.deepin.com/deepin apricot/main amd64 libjson-perl all 4.02000-1 [88.8 kB]
Get:7 https://community-packages.deepin.com/deepin apricot/main amd64 libtypes-serialiser-perl all 1.0-1 [12.7 kB]
Get:8 https://community-packages.deepin.com/deepin apricot/main amd64 libjson-xs-perl amd64 3.040-1+b1 [91.0 kB]
Get:9 https://community-packages.deepin.com/deepin apricot/main amd64 libllvm7 amd64 1:7.0.1-8 [13.0 MB]
Get:10 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-common all 226.pgdg100+1 [246 kB]
Get:11 https://community-packages.deepin.com/deepin apricot/main amd64 sysstat amd64 12.0.3.1-2+security [551 kB]
Get:12 http://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-13 amd64 13.3-1.pgdg100+1 [14.9 MB]

Step 5. Start Database Server & Check status of the service

To start the database server, use the command as shown below;

sudo pg_ctlcluster 13 main start

To check status, use the command as shown below;

systemctl status [email protected]

The output is as shown below;

[email protected]:~$ systemctl status [email protected]
 [email protected] - PostgreSQL Cluster 13-main
   Loaded: loaded (/lib/systemd/system/[email protected]; enabled-runtime; ven
   Active: active (running) since Wed 2021-07-14 12:14:12 EAT; 14min ago
 Main PID: 13619 (postgres)
    Tasks: 7 (limit: 2245)
   Memory: 17.3M
   CGroup: /system.slice/system-postgresql.slice/[email protected]
           ├─13619 /usr/lib/postgresql/13/bin/postgres -D /var/lib/postgresql/13
           ├─13621 postgres: 13/main: checkpointer
           ├─13622 postgres: 13/main: background writer
           ├─13623 postgres: 13/main: walwriter
           ├─13624 postgres: 13/main: autovacuum launcher
           ├─13625 postgres: 13/main: stats collector
           └─13626 postgres: 13/main: logical replication launcher

Step 5. Start PostgreSQL Prompt

To start PostgreSQL, use the command as shown below;

sudo su - postgres

The output;

[email protected]:~$ sudo su - postgres
[sudo] password for daylifetips: 
Verification successful
[email protected]:~$ 

On this tutorial, we have shown you how to install PostgreSQL Server 13 on Deepin Linux 20.x, how to check its status, and how to launch it. Enjoy its usage and give feedback.

Other Posts;

Previous articleInstall MariaDB Server 10.5 on Deepin Linux 20.x
Valentine is eager to learn new things, technology and life issues. She is curious enough to write about them. And, she uses her platform to educate others regarding the many sectors in life and most importantly technology.

LEAVE A REPLY

Please enter your comment!
Please enter your name here