Release Found: Red Hat Enterprise Linux 5 and later
You can use yumdownloader with the --source option to download source RPM packages.
In order to use the yumdownloader utility, make sure that you have the yum-utils package installed on the machine.
# rpm -q yum-utils
If you do not have the yum-utils package installed, you can use the yum utility to install the package:
# yum install yum-utils
The next step is to configure a yum repository to download source packages.
To create a new repository, open a new file /etc/yum.repos.d/rhel-src.repo and add the following configuration directive:
[rhel-src]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Now download the source package(s) using yumdownloader.
For example:
# yumdownloader --source openldap