Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been attempting to create a manifest for installing postgres 9.1 using puppet on a Centos 5 server. I have been trying to adapt the instructions at in order to achieve this and when I go through a manual process, I have been able to.

It would seem to me therefore that a puppet manifest containing

package { 'postgresql91-server':
  ensure => installed,
  source => ''

however on attempting to apply this manifest I get

err: /Stage[main]//Package[postgresql91-server]/ensure: change from absent to present failed: Could not find package postgresql91-server

Any expert puppeteers out there able to help me?

share|improve this question
Removed postgresql tag - this question applies to any package with dependencies not available in a local repository. +1 for including exact error message text, commands and (some) version numbers. – Craig Ringer Dec 19 '12 at 1:52
up vote 9 down vote accepted

Add the repo to yum (using puppet of course), then specify the repo resource as a dependency of the package. This will make upgrading easier later on. See the puppet docs on yum repos for more info.

share|improve this answer
Thanks very much for this – Mr Wilde Dec 19 '12 at 14:18

Thanks to all help from Steve and Paul. The final code that I have used is

yumrepo { "postgres":
  baseurl => "",
  descr => "Postgres 9.1 repository",
  enabled => 1,
  gpgcheck => 1

package { 'postgresql91-server' :
  ensure => installed,

This does the trick!

share|improve this answer
gpgcheck => 0 isn't the best idea if you can avoid that. Are postgresql really releasing unsigned RPMs in their yumrepo? – Paul Gear Dec 20 '12 at 6:28
I'll make a change to gpgcheck => 1 as they do sign their rpms. Thanks for the advice – Mr Wilde Dec 21 '12 at 10:49

According to, source is dependent upon the underlying package provider supporting it. To my knowledge, yum doesn't allow arbitrary URLs - you must specify a repo (as Steve Wills mentioned).

You might be able to work around this by specifying 'provider => "rpm"' for just this package resource, but i've not tried this myself.

share|improve this answer
Yum does allow arbitrary URLs, but it cannot work out that the URL is part of a yum respository and fetch dependencies from the same repository. You can install from a URL to an RPM only if you have a locally defined repo that contains all the dependencies or the dependencies of the package are already installed. – Craig Ringer Dec 19 '12 at 1:52

Your Answer


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.