I would like to setup a local repo for rhel 5 and 6. Can this be done on 1 server, or do I need one server for each major version?

We have a valid, legal subscription with RH, but we would rather not pay for RH satellite.


You can build packages for EL5 on an EL6 box, but the problem is that EL6 has a newer version of RPM that writes files incompatible with the version of RPM shipped with EL5. You can work around this with some arguments to rpmbuild when building your source packages, preferably in a wrapper script. Something like this will cause rpmbuild to use the older format:

# Assumes you have an RPM environment set up in ~/rpmbuild using rpmdev-setuptree
# Argument 1: a spec file in ~/rpmbuild/SPECS
# Build the EL6 SRPM
rpmbuild -bs $1
# Build the EL5 SRPM
rpmbuild \
  --define "_source_filedigest_algorithm 1" \
  --define "_binary_filedigest_algorithm 1" \
  --define "_binary_payload w9.gzdio" \
  --define="dist .el5" \
  --define="el5 1" \

Once the SRPMs are built, you can then run mock on the EL5 and EL6 SRPMs, respectively:

for el in 5 6; do
  for package in ~/rpmbuild/SRPMS/*.el{$el}.src.rpm; do
    for arch in x86_64 i386; do
      mock -r epel-{$el}-{$arch} $package
  • I don't think we will be doing any package building - this would just be for OS updates and what not. – chris Jan 17 '13 at 5:02
  • Oh, you just want a local mirror of the Red Hat packages? Sorry, you get to buy Satellite. – Michael Hampton Jan 17 '13 at 5:11
  • It's definitely possible to create a local yum repository to update your RHEL servers WITHOUT buying satellite.. This guy has an excellent guide: kenfallon.com/how-to-mirror-rhn-behind-your-firewall – chris Jan 18 '13 at 0:26
  • @chris That might work, but it's not supported by Red Hat, and it also could be used for piracy. So I wouldn't mention it here. – Michael Hampton Jan 18 '13 at 0:32

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.