2

I am trying to create a RHEL 6 repository, but since I have a RHEL 7 repository, I was thinking if it is possible to create that repo on the same server.

I already have a valid and currently registered subscription on the RHEL 7 server, but when y run # subscription-manager repos --list I only see RHEL 7 repos on the list and whey I try adding rhel-6-server-rpms repo (which appears to be part of the content I have available in my subscription) I get:

subscription-manager repos --enable=rhel-6-server-rpms

Error: 'rhel-6-server-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.

Any ideas of what is happening or how can I enable that repo?

1
2

No.

The repos for RHEL 6 are not available for RHEL 7 because there would be a carnival of package conflicts, dependency hells on earth, and utter chaos.

Can you imagine yum trying to install RHEL 6 packages or just packages that aren't compatible with what's available in RHEL 7 because the former is deprecated?

The subscription manager doesn't allow what you're trying to do for this very reason.

1
  • Yes, that makes total sense. I just thought there was a way to define those not to be actually used. Thanks for the answer, Nasir! – anairinac May 14 '18 at 15:16
1

Old question, but since I just had to finish doing this, yes it's possible. You require a valid subscription for RHEL 6 and 7.

Subscribe both hosts using subscription-manager register;subscription-manager attach --auto then run yum clean all.

Copy the entitlement keys from /etc/pki/entitlement on the RHEL 6 host to the same folder on the RHEL 7 host.

Copy the redhat.repo file from /etc/yum.repos.d/ on the RHEL 6 host into the same folder on the RHEL 7 host. NOTE: Name this file something else, like rhel-6.repo, because the redhat.repo is overwritten when you run a yum clean all.

Now run a yum clean all and ensure none of the keys or repo files were removed.

If everything is still intact, you're ready to to create the local repo. Install/Start httpd. Create a directory mkdir /var/www/html/rhel6/. Run reposync --gpgcheck -l --repoid=rhel-6-workstation-rpms --download_path=/var/www/html/rhel6/ --downloadcomps --download-metadata --newest-only Once the download is complete, create the repo with: createrepo -v /var/www/html/rhel6/rhel-6-workstation-rpms/ -g comps.xml

Now any other RHEL 6 hosts can point to http://server-ip/rhel6/rhel-6-workstation-rpms/ I would suggest setting up HTTPS, but this will get you going. You can also repeat these steps for any other RHEL 6 repos like optional or extras if you wish. This is really useful when you want to host an internal repo, cutting down external bandwidth.

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.