Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us

Install PostgreSQL on Linux operating system

 Atikh Shaikh     PostgreSQL     No comments   

In previous articles, we have discussed the introduction to PostgreSQL and installation of Postgres on Windows system in this article, we will discuss Installing PostgreSQL 14 on the Linux operating system

Follow the below steps to install PostgreSQL 14.10 on the Linux operating system

introduction - Introduction to PostgreSQL

Installation of PostgreSQL on Linux


Step 1: Make sure your Linux system is up to date, run the below command to update the system

If your Linux system is up to date, skip this step and start with step 2

sudo yum update

[oracle@localhost Desktop]$ sudo yum update

[sudo] password for oracle:

Oracle Linux 8 BaseOS Latest (x86_64)                                        3.0 kB/s | 3.6 kB     00:01   

Oracle Linux 8 Application Stream (x86_64)                                   8.6 kB/s | 3.9 kB     00:00   

Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux 8 (x86_64)   4.0 kB/s | 3.0 kB     00:00   

Dependencies resolved.

============================================================================================

 Package                Arch        Version                    Repository              Size

============================================================================================

Installing:

 kernel                 x86_64      4.18.0-513.9.1.el8_9       ol8_baseos_latest       10 M

 kernel-uek             x86_64      5.15.0-201.135.6.el8uek    ol8_UEKR7              2.0 M

Upgrading:

 ModemManager           x86_64      1.20.2-1.el8               ol8_baseos_latest      1.2 M

 kernel-devel           x86_64      4.18.0-513.9.1.el8_9       ol8_baseos_latest       24 M

Removing:

 kernel-core            x86_64      4.18.0-425.3.1.el8         @anaconda               70 M

 kernel-modules         x86_64      4.18.0-425.3.1.el8         @anaconda               24 M

 

Transaction Summary

================================================================

Install   27 Packages                                          

Upgrade  582 Packages                                          

Remove     2 Packages                                     

Total download size: 1.3 G                                     

Is this ok [y/N]: y                                            

Downloading Packages:                                          

(1/609): kernel-devel-4.18.0-513.9.1.el8_9.x86_64.rpm            2.2 MB/s |  24 MB     00:10   

...                                                            

(608/609): ndctl-libs-73-1.0.2.el8.x86_64.rpm                    544 kB/s |  87 kB     00:00   

(609/609): webkit2gtk3-2.40.5-1.el8_9.1.x86_64.rpm               4.2 MB/s |  24 MB     00:05   

-------------------------------------------------------------------------------------------------

Total                                                            6.2 MB/s | 1.3 GB     03:31    

Running transaction check                                      

Transaction check succeeded.                                   

Running transaction test                                       

Transaction test succeeded.                                    

Running transaction                                            

Installed:

  bison-3.0.4-10.el8.x86_64         flex-2.6.1-9.el8.x86_64                                                       

  wpebackend-fdo-1.10.0-3.el8.x86_64                   

Removed:

  kernel-core-4.18.0-425.3.1.el8.x86_64     kernel-modules-4.18.0-425.3.1.el8.x86_64                                      

Complete!

[oracle@localhost Desktop]$

[oracle@localhost Desktop]$ 

 

Step 2: Install PostgreSQL library from the official PostgreSQL repository

sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

 

[oracle@localhost Desktop]$ sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Last metadata expiration check: 0:50:05 ago on Mon 01 Jan 2024 03:25:25 PM UTC.

pgdg-redhat-repo-latest.noarch.rpm       9.2 kB/s |  13 kB     00:01   

Dependencies resolved.

========================================================================

 Package                Architecture    Version       Repository   Size

========================================================================

Installing:

 pgdg-redhat-repo       noarch          42.0-35PGDG   @commandline 13 k

Transaction Summary

========================================================================

Install  1 Package

Total size: 13 k

Installed size: 15 k

Downloading Packages:

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                        1/1

  Installing       : pgdg-redhat-repo-42.0-35PGDG.noarch    1/1

  Verifying        : pgdg-redhat-repo-42.0-35PGDG.noarch    1/1

Installed:

  pgdg-redhat-repo-42.0-35PGDG.noarch                          

Complete!

[oracle@localhost Desktop]$

 

Step 3: Install PostgreSQL

Use the below command to install PostgreSQL 14.10

sudo yum install postgresql14-server

 

[oracle@localhost Desktop]$ sudo yum install postgresql14-server

Last metadata expiration check: 0:01:48 ago on Mon 01 Jan 2024 04:19:30 PM UTC.

Dependencies resolved.

======================================================================================

 Package                    Architecture     Version               Repository    Size

======================================================================================

Installing:

 postgresql14-server        x86_64           14.10-2PGDG.rhel8     pgdg14       5.7 M

Installing dependencies:

 postgresql14               x86_64           14.10-2PGDG.rhel8     pgdg14       1.5 M

 postgresql14-libs          x86_64           14.10-2PGDG.rhel8     pgdg14       280 k

 

Transaction Summary

=====================================================================================

Install  3 Packages

Total download size: 7.5 M

Installed size: 32 M

Is this ok [y/N]: y

Downloading Packages:

(1/3): postgresql14-libs-14.10-2PGDG.rhel8.x86_64.rpm       158 kB/s | 280 kB     00:01   

(2/3): postgresql14-14.10-2PGDG.rhel8.x86_64.rpm            575 kB/s | 1.5 MB     00:02   

(3/3): postgresql14-server-14.10-2PGDG.rhel8.x86_64.rpm     1.5 MB/s | 5.7 MB     00:03   

--------------------------------------------------------------------------------------------

Total                                                       1.9 MB/s | 7.5 MB     00:03    

PostgreSQL 14 for RHEL / Rocky 8 - x86_64                   1.6 MB/s | 1.7 kB     00:00   

Importing GPG key 0x442DF0F8:

 Userid     : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"

 Fingerprint: 68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

Is this ok [y/N]: y

Key imported successfully

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                  1/1

  Installing       : postgresql14-libs-14.10-2PGDG.rhel8.x86_64       1/3

  Running scriptlet: postgresql14-libs-14.10-2PGDG.rhel8.x86_64       1/3

  Installing       : postgresql14-14.10-2PGDG.rhel8.x86_64            2/3

  Running scriptlet: postgresql14-14.10-2PGDG.rhel8.x86_64            2/3

  Running scriptlet: postgresql14-server-14.10-2PGDG.rhel8.x86_64     3/3

  Installing       : postgresql14-server-14.10-2PGDG.rhel8.x86_64     3/3

  Running scriptlet: postgresql14-server-14.10-2PGDG.rhel8.x86_64     3/3

"/home" already exists and is not a directory.

  Verifying        : postgresql14-14.10-2PGDG.rhel8.x86_64            1/3

  Verifying        : postgresql14-libs-14.10-2PGDG.rhel8.x86_64       2/3

  Verifying        : postgresql14-server-14.10-2PGDG.rhel8.x86_64     3/3

Installed:

  postgresql14-14.10-2PGDG.rhel8.x86_64           postgresql14-libs-14.10-2PGDG.rhel8.x86_64          

  postgresql14-server-14.10-2PGDG.rhel8.x86_64         

Complete!

[oracle@localhost Desktop]$

 

Step 4 :

The above three steps are to install PostgreSQL on Linux, now before using Postgres cluster, we need to setup your database library, use the below command

sudo /usr/pgsql-14/bin/postgresql-14-setup initdb

[oracle@localhost Desktop]$ sudo /usr/pgsql-14/bin/postgresql-14-setup initdb

Initializing database ... OK

[oracle@localhost Desktop]$

 

Step 5 : Start the PostgreSQL cluster

Below command sudo systemctl start postgresql-14 to start PostgreSQL services

[oracle@localhost Desktop]$ sudo systemctl start postgresql-14

[oracle@localhost Desktop]$

 

Step 6 : enable the PostgreSQL services

Command sudo systemctl enable postgresql-14

[oracle@localhost Desktop]$ sudo systemctl enable postgresql-14

Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-14.service → /usr/lib/systemd/system/postgresql-14.service.

[oracle@localhost Desktop]$

 

Step 7 : Switch to Postgres users and login to the PostgreSQL instance

[oracle@localhost Desktop]$ sudo -i -u postgres

[postgres@localhost ~]$

[postgres@localhost ~]$ id

uid=26(postgres) gid=26(postgres) groups=26(postgres) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[postgres@localhost ~]$

[postgres@localhost ~]$ psql -V

psql (PostgreSQL) 14.10

[postgres@localhost ~]$

Login to PostgreSQL database cluster

[postgres@localhost ~]$ psql

psql (14.10)

Type "help" for help.

postgres=# \l

                                  List of databases

   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges  

-----------+----------+----------+-------------+-------------+-----------------------

 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |

 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +

           |          |          |             |             | postgres=CTc/postgres

 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +

           |          |          |             |             | postgres=CTc/postgres

(3 rows)

 

postgres=#

 

This concludes installation of PostgreSQL on the Linux operating system

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit

lsb_release: command not found... : Linux/ Database Admin

 Atikh Shaikh     MongoDB, mysql, oracle, PostgreSQL     No comments   

As Database Admin, Linux Admin, or system admin, you must have come across this error or situation, 

Here I was trying to see release details of the Linux operating system using the lsb_release command but it failed with the below error. 

On seeing this error, I thought lsb_release was not installed on the server, so I tried to install using the yum command but it failed with the error "Error: Unable to find a match: lsb_release" 

[root@localhost bin]# lsb_release 

bash: lsb_release: command not found...

 

[root@localhost bin]# yum install lsb_release

Last metadata expiration check: 0:07:24 ago on Sat 30 Dec 2023 11:04:11 AM UTC.

No match for argument: lsb_release

Error: Unable to find a match: lsb_release

[root@localhost bin]# 

 

So here is the trick, you need to identify which package provides this command using the below method

[root@localhost bin]# yum whatprovides lsb_release

Last metadata expiration check: 0:05:10 ago on Sat 30 Dec 2023 11:04:11 AM UTC.

redhat-lsb-core-4.1-47.0.1.el8.i686 : LSB Core module support

Repo        : ol8_appstream

Matched from:

Filename    : /usr/bin/lsb_release

redhat-lsb-core-4.1-47.0.1.el8.x86_64 : LSB Core module support

Repo        : ol8_appstream

Matched from:

Filename    : /usr/bin/lsb_release

[root@localhost bin]# 

 

Here we see package redhat-lsb-core provides the lsb_release command, so to access lsb_release we need to install the redhat-lsb-core package, let's try to install it

 

[root@localhost bin]# yum install redhat-lsb-core

Last metadata expiration check: 0:12:20 ago on Sat 30 Dec 2023 11:04:11 AM UTC.

Dependencies resolved.

==============================================================================================================================================================

 Package                                        Architecture               Version                                Repository                             Size

==============================================================================================================================================================

Installing:

 redhat-lsb-core                                x86_64                     4.1-47.0.1.el8                         ol8_appstream                          46 k

Installing dependencies:

 m4                                             x86_64                     1.4.18-7.el8                           ol8_baseos_latest                     222 k

 mailx                                          x86_64                     12.5-29.el8                            ol8_baseos_latest                     257 k

 ncurses-compat-libs                            x86_64                     6.1-9.20180224.el8                     ol8_baseos_latest                     328 k

 patch                                          x86_64                     2.7.6-11.el8                           ol8_baseos_latest                     139 k

 postfix                                        x86_64                     2:3.5.8-7.el8                          ol8_baseos_latest                     1.5 M

 redhat-lsb-submod-security                     x86_64                     4.1-47.0.1.el8                         ol8_appstream                          22 k

 spax                                           x86_64                     1.5.3-13.el8                           ol8_baseos_latest                     217 k

 

Transaction Summary

==============================================================================================================================================================

Install  8 Packages

 

Total download size: 2.7 M

Installed size: 7.0 M

Is this ok [y/N]: y

Downloading Packages:

(1/8): mailx-12.5-29.el8.x86_64.rpm                                                                                           980 kB/s | 257 kB     00:00    

(2/8): m4-1.4.18-7.el8.x86_64.rpm                                                                                             820 kB/s | 222 kB     00:00    

(3/8): ncurses-compat-libs-6.1-9.20180224.el8.x86_64.rpm                                                                      1.1 MB/s | 328 kB     00:00    

(4/8): patch-2.7.6-11.el8.x86_64.rpm                                                                                          1.3 MB/s | 139 kB     00:00    

(5/8): spax-1.5.3-13.el8.x86_64.rpm                                                                                           2.1 MB/s | 217 kB     00:00    

(6/8): redhat-lsb-core-4.1-47.0.1.el8.x86_64.rpm                                                                              691 kB/s |  46 kB     00:00    

(7/8): redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64.rpm                                                                   468 kB/s |  22 kB     00:00    

(8/8): postfix-3.5.8-7.el8.x86_64.rpm                                                                                         5.6 MB/s | 1.5 MB     00:00    

--------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                         4.9 MB/s | 2.7 MB     00:00     

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                                                                                                      1/1 

  Installing       : redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64                                                                                     1/8 

  Installing       : spax-1.5.3-13.el8.x86_64                                                                                                             2/8 

  Running scriptlet: spax-1.5.3-13.el8.x86_64                                                                                                             2/8 

  Running scriptlet: postfix-2:3.5.8-7.el8.x86_64                                                                                                         3/8 

  Installing       : postfix-2:3.5.8-7.el8.x86_64                                                                                                         3/8 

  Running scriptlet: postfix-2:3.5.8-7.el8.x86_64                                                                                                         3/8 

  Installing       : patch-2.7.6-11.el8.x86_64                                                                                                            4/8 

  Installing       : ncurses-compat-libs-6.1-9.20180224.el8.x86_64                                                                                        5/8 

  Installing       : mailx-12.5-29.el8.x86_64                                                                                                             6/8 

  Installing       : m4-1.4.18-7.el8.x86_64                                                                                                               7/8 

  Running scriptlet: m4-1.4.18-7.el8.x86_64                                                                                                               7/8 

  Installing       : redhat-lsb-core-4.1-47.0.1.el8.x86_64                                                                                                8/8 

  Running scriptlet: redhat-lsb-core-4.1-47.0.1.el8.x86_64                                                                                                8/8 

  Verifying        : m4-1.4.18-7.el8.x86_64                                                                                                               1/8 

  Verifying        : mailx-12.5-29.el8.x86_64                                                                                                             2/8 

  Verifying        : ncurses-compat-libs-6.1-9.20180224.el8.x86_64                                                                                        3/8 

  Verifying        : patch-2.7.6-11.el8.x86_64                                                                                                            4/8 

  Verifying        : postfix-2:3.5.8-7.el8.x86_64                                                                                                         5/8 

  Verifying        : spax-1.5.3-13.el8.x86_64                                                                                                             6/8 

  Verifying        : redhat-lsb-core-4.1-47.0.1.el8.x86_64                                                                                                7/8 

  Verifying        : redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64                                                                                     8/8 

 

Installed:

  m4-1.4.18-7.el8.x86_64          mailx-12.5-29.el8.x86_64                 ncurses-compat-libs-6.1-9.20180224.el8.x86_64       patch-2.7.6-11.el8.x86_64   

  postfix-2:3.5.8-7.el8.x86_64    redhat-lsb-core-4.1-47.0.1.el8.x86_64    redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64    spax-1.5.3-13.el8.x86_64    

 

Complete!

[root@localhost bin]# 

 

After installation, I was able to access it 

 

[root@localhost bin]# lsb_release 

LSB Version:   :core-4.1-amd64:core-4.1-noarch

[root@localhost bin]# 

 


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Newer Posts Older Posts Home

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (73)

Blog Archive

  • ►  2018 (38)
    • ►  November (25)
    • ►  December (13)
  • ►  2019 (33)
    • ►  January (15)
    • ►  February (6)
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ▼  2024 (5)
    • ▼  January (2)
      • lsb_release: command not found... : Linux/ Databa...
      • Install PostgreSQL on Linux operating system
    • ►  March (3)
  • ►  2025 (5)
    • ►  March (1)
    • ►  April (3)
    • ►  May (1)

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • Oracle 23ai : The all new Hybrid Read-Only for pluggable databases (PDBs)
      The latest Oracle database version, Oracle 23ai, introduced a new open mode called Hybrid Read-Only for pluggable databases (PDBs). Local ...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger