I am new to linux and wants to understand the reason for using some commands. I am trying to install PostgreSQL on CentOs by following the instructions here.

First we do rpm -ivh pgdg-centos91-9.1-4.noarch.rpm which installs the rpm package into the system. But why does it ask us to do yum install postgresql91-server (which i assume installs postgresql) again if we have used rpm -ivh to install the package?

Additionally, what is the reason for adding the lines exclude=postgresql* into /etc/yum.repos.d/CentOS-Base.repo under [base] and [updates]. Why is it that we exclude yum from accessing these packages, then use yum to install postgresql91-server?


yum interfaces with the online repository related to your version of CentOS.

rpm is the package manager and packaging format for applications developed for the Red Hat/CentOS platform. Your rpm command is installing a packaged that was downloaded and is not part of a yum repository.

In the Windows world, it's like the difference between Windows Update (yum) and downloading a piece of software and double-clicking an installer (rpm).

It also appears as though you're using a version of postgresql that is newer than the one available through the normal CentOS channels ("Base" and "Updates"). The package being installed by the yum command you listed is coming from a different third-party software repository.

It looks like you're using the postgres database packages provided directly be PostgreSQL instead of the ones that come via CentOS. The instructions and reasoning are detailled here.

As a result, you've been asked to prevent the version that's is distributed with CentOS from installing by using the exclude= statements you listed. This is a precautionary measure to avoid a conflict between the older version of postgresql from CentOS and the newer one you're installing.

  • Thanks for the reply. Why insert the exclude=postgresql* then do a yum install postgresql91-server? Also, doesnt rpm -ivh already perform the installation, why continue with a yum install? – Nyxynyx Sep 10 '12 at 0:42
  • @Nyxynyx The pgdg-centos91* file contains the information that tells your system where to look in order to actually download the PostgreSQL packages via yum. So you have to install that part manually using rpm. See my edited answer above. – ewwhite Sep 10 '12 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.