Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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