Whats with the syntax of something followed by parentheses?
From http://jfearn.fedorapeople.org/en-US/RPM/0.1/html/RPM_Guide/ch-advanced-packaging.html:
Scripting languages such as Perl and
Tcl allow for add-on modules. Your
package may require some of these
add-on modules. RPM uses a special
syntax with parenthesis to indicate
script module dependencies. For
example: Requires: perl(Carp) >= 3.2
This indicates a requirement for the
Carp add-on module for Perl, greater
than or equal to version 3.2.
In this case, it is referring to particular features of the rpm library.
error: Failed dependencies:
rpmlib(FileDigests) <= 4.6.0-1 is needed by epel-release-6-5.noarch
rpmlib(PayloadIsXz) <= 5.2-1 is needed by epel-release-6-5.noarch
This suggests you're trying to install the epel-release
rpm on a system for which it was not designed. In fact, in your question, you state you're installing this on CentOS 5, while the package you're attempting to install is designed for CentOS 6 (or RHEL 6). For CentOS 5, you want epel-release-5-4.noarch.rpm. You might want to read the EPEL documentation before you proceed, which would have answered this question as well as others you might have.
Ive tried to use yum so that it can resolve dependencies automatically but it is unable:
Right, because those features aren't available on CentOS 5. From the perspective of yum
you've asked it for magic unicorns. It can't find any.
Bonus points if you tell me how I can fix the public key error.
Install the EPEL signing key. If you read the EPEL documentation -- it's amazing what you'll find there -- you'll get a link to https://fedoraproject.org/keys, which includes instructions on installing the public keys used by the Fedora project.
It is possible to download the packages of an RPM which is already installed using the --downloadonly
switch. I am not sure why yum doesn't check this setting before checking whether the package is already installed, but I guess it could be caused by the underlying architecture of the tool.
Anyway, all you need to do is to tell yum to reinstall the package:
yum --downloadonly --downloaddir=/tmp/rpm_files/ reinstall package_name
Of course, yum will not know which dependencies were installed just for this package, so if you take the RPMs and try to install them on a different system, some dependencies might be missing. There are ways to explore the whole dependency graph and I'm sure this was already described elsewhere on SE.
Best Answer
CentOS have great documentation on how to use Kickstart files in order to achieve what you want.
I don't see the point in copy/pasting that entire page, so I'll just link to it: https://projects.centos.org/trac/livecd/wiki/KickstartFile
It falls under automated installations: http://www.centos.org/docs/5/html/5.1/Installation_Guide/ch-kickstart2.html
What are Kickstart Installations?