I'm trying to install PostgreSQL 9.5 on CentOS 7.

I've searched online and to get access to the 9.5 RPMs it requires installation of pgdg95 via the following command:

sudo rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm

I'm installing PostgreSQL 9.5 via my own PostgreSQL RPM. The RPM I'm installing contains my own scripts and I will use the rpm-maven-plugin to map them to server. I'm also using this plugin to install the PostgreSQL 9.5 packages by adding them to the <requires> section of the POM.xml configuration.

        <license>GPL (c) 2005, SWWDC</license>



As you can see, I've added both a pre-install and prep-install script to the package which are automatically run during YUM installing the package. The problem is that the requires runs before both of these scripts and they fail because the pgdg95 RPM is not installed.

How can I run the command at the start of the question before the require'd RPMs are installed? Prep/pre install scripts don't seem to work as the requires is running before them.


The solution I implemented was to add the repo at installation time using the following line within the kickstart:

repo --name="PostgreSQL" --baseurl="http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/"

and then to add in the POM.xml:


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.