How to add third party repositories (e.g. EPEL or Centrify for Red Hat Enterprise Linux 6) in Red Hat Satellite 5.x?

Solution Verified - Updated -

Environment

  • Red Hat Satellite 5.X
  • Red Hat Enterprise Linux 5 and above

Issue

  • Need to create and sync some third party repositories in Red Hat Satellite.
  • How does one add non-redhat repositories to a satellite server?
  • How can a third party repository be added to the satellite so that the servers gets updated when when we do a yum update ?
  • How to host my local repository on satellite server so that it can be shared with all the clinets ?

Resolution

To Sync a third party repository on RHN Satellite, follow the procedure given below. In the following steps, the example is taken of "EPEL" repository.

  • Go to the Satellite Web-UI through browser, then select Channels => Manage Software Channels. Here you can see create new channel link. Click on that.

  • It will open a Create Software Channel page, in Details tab, provide the following (As an example, EPEL is selected, so provide the details according to the requirements.)

Channel Name*: EPEL for Red Hat Enterprise Linux 6
Channel Label*: epel_rhel6_x86_64
Parent Channel: Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) 
Parent Channel Architecture: x86_64
Yum Repository Checksum Type: sha1
Channel Summary*: EPEL Repository

Some other information can be filled, but it's not mandatory to fill all of the information. Then click on Create Channel.

  • In the left corner, click on Manage Repositories, and then on Right corner, click on create new repository. Provide two details there. As testing is done for EPEL Repository for Red Hat Enterprise Linux 6 x86_64 bit, put the information as follows.
Repository Label*   epel_repo_rhel6_x86_64
Repository URL*     http://mirrors.kernel.org/fedora-epel/6Server/x86_64/
  • In case of centrify repo, you need to provide username and password in URL declaration*
Repository Label:    centrify
Repository URL:       https://USERNAME:PASSWORD@repo.centrify.com/rpm-redhat/ <== replace USERNAME/PASSWORD 

Note: If the mirror URL above does not work then please choose a new mirror from the Fedora EPEL mirror list

Then click on Create Repository Button. It will display "Repository created successfully"

  • To sync the repositories, click on Manage Software Channel on Left side Box, and search for epel_repo_rhel6_x86_64, here in Repositories tab of "epel_rhel6_x86_64", and then select "epel_repo_rhel6_x86_64" which is the newly created repository. Tick in the check-box given in front of the same. Click Update Repositories button. Now the repository is aligned to the channel.

  • In the same page, see sync subtab under Repository tab. Click on Sync. Now, click on the Sync Now button to sync the repository right, or it can be scheduled later.

  • After completing sync, go to the Systems tab and select any test Red Hat Enterprise Linux 6 machine. Click on Alter Channel Subscription and select EPEL for Red Hat Enterprise Linux 6 Channel. And save.

  • Go on the same client machine and run the following command to see if the repository is enabled or not.

# yum repolist

For more details, the documentation is available on Portal, click here to go to the Documentation

If you want to sync it manually or through the command line use :

# spacewalk-repo-sync -c <channel label> -u http://mirrors.kernel.org/fedora-epel/6Server/x86_64/
# spacewalk-repo-sync -c <channel label> -u https://USERNAME:PASSWORD@repo.centrify.com/rpm-redhat/

To check the progress of the repo sync, please check the logs on:

/var/log/rhn/reposync/{channel name} {date}.log

Note: Make sure URL is correct. If the mirror URL above does not work then please choose a new mirror from the Fedora EPEL mirror list

For repos containing packages with same name/version (NVREA) but different content / checksums, see How to store packages with same name/version (nvrea) but different content/checksum in Satellite 5.x?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

11 Comments

After I create software shannel and linked repository i got error with sync repository:

# spacewalk-repo-sync -c epel_rhel6_x86_64 -u http://mirrors.servercentral.net/fedora/epel/6/x86_64/
Traceback (most recent call last):
  File "/usr/bin/spacewalk-repo-sync", line 72, in ?
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-repo-sync", line 66, in main
    sync.main()
  File "/usr/share/rhn/satellite_tools/reposync.py", line 103, in main
    self.import_packages(plugin, url)
  File "/usr/share/rhn/satellite_tools/reposync.py", line 135, in import_packages
    packages = plug.list_packages()
  File "/usr/share/rhn/satellite_tools/repo_plugins/yum_src.py", line 75, in list_packages
    sack.populate(repo, 'metadata', None, 0)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 168, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 226, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1226, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1399, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1395, in _getRepoXML
    raise Errors.RepoError, msg
yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for repository: epel_rhel6_x86_64. Please verify its path and try again

Server info:

[root@satellite ]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
[root@satellite ]# cat /etc/spacewalk-release 
Spacewalk release 1.2 (Smile)

[root@satellite ]# rpm -qa sat* spacewalk* rhn*
satellite-doc-indexes-5.4.4-1.el5sat
satellite-branding-5.4.0.11-1.el5sat
satellite-schema-5.4.0.21-1.el5sat
spacewalk-selinux-1.2.1-5.el5sat
spacewalk-search-1.2.3-4.el5sat
spacewalk-backend-sql-oracle-1.2.13-79.el5sat
spacewalk-backend-config-files-common-1.2.13-79.el5sat
spacewalk-backend-config-files-1.2.13-79.el5sat
spacewalk-monitoring-1.1.1-1.el5sat
spacewalk-reports-1.2.2-4.el5sat
spacewalk-base-1.2.7-22.el5sat
spacewalk-sniglets-1.2.7-22.el5sat
spacewalk-taskomatic-1.2.39-133.el5sat
spacewalk-backend-iss-export-1.2.13-79.el5sat
spacewalk-setup-1.2.6-11.el5sat
spacewalk-html-1.2.7-22.el5sat
spacewalk-admin-1.2.4-4.el5sat
spacewalk-grail-1.2.7-22.el5sat
spacewalk-backend-app-1.2.13-79.el5sat
spacewalk-backend-xp-1.2.13-79.el5sat
spacewalk-monitoring-selinux-1.1.1-3.el5sat
spacewalk-java-config-1.2.39-133.el5sat
spacewalk-backend-sql-1.2.13-79.el5sat
spacewalk-backend-upload-server-1.2.13-79.el5sat
spacewalk-cypress-0.5.23-35.el5sat
spacewalk-java-lib-1.2.39-133.el5sat
spacewalk-java-1.2.39-133.el5sat
spacewalk-backend-libs-1.2.13-79.el5sat
spacewalk-backend-1.2.13-79.el5sat
spacewalk-backend-package-push-server-1.2.13-79.el5sat
spacewalk-backend-tools-1.2.13-79.el5sat
spacewalk-moon-0.5.23-35.el5sat
spacewalk-certs-tools-1.1.1-1.el5sat
spacewalk-ssl-cert-check-2.0-1.el5sat
spacewalk-common-1.2.1-4.el5sat
spacewalk-base-minimal-1.2.7-22.el5sat
spacewalk-utils-1.2.1-18.el5sat
spacewalk-backend-xml-export-libs-1.2.13-79.el5sat
spacewalk-backend-iss-1.2.13-79.el5sat
spacewalk-slf4j-1.6.1-4.el5sat
spacewalk-config-1.2.2-7.el5sat
spacewalk-setup-jabberd-1.2.1-2.el5sat
spacewalk-oracle-1.2.1-4.el5sat
spacewalk-schema-1.2.21-17.el5sat
spacewalk-backend-server-1.2.13-79.el5sat
spacewalk-backend-config-files-tool-1.2.13-79.el5sat
spacewalk-pxt-1.2.7-22.el5sat
spacewalk-dobby-1.2.7-22.el5sat
spacewalk-java-oracle-1.2.39-133.el5sat
spacewalk-backend-xmlrpc-1.2.13-79.el5sat
spacewalk-backend-applet-1.2.13-79.el5sat
rhn_solaris_bootstrap_5_4_1_5-1-1.el5sat
rhn_solaris_bootstrap_5_4_1_9-1-1.el5sat
rhn-check-0.4.20-86.el5
rhn-i18n-release-notes-5.4.0.8-1.el5sat
rhnpush-5.5.4-12.el5sat
rhnlib-2.5.22-7.el5
rhn_solaris_bootstrap_5_3_0_10-1-0.el5sat
rhn-org-httpd-ssl-key-pair-kstart-1.0-4
rhn-client-tools-0.4.20-86.el5
rhn-upgrade-5.5.0.18-1.el5sat
rhn-setup-0.4.20-86.el5
rhn-org-trusted-ssl-cert-1.0-1
rhn-i18n-guides-5.4.0.8-1.el5sat
rhn-solaris-bootstrap-5.4.1-9.el5sat
rhnsd-4.7.0-14.el5

Updated info:
Target server is RHEL6,
Satellite server is RHEL 5 + RHN Satellite release 5.4.1

spacewalk-repo-sync run on Satellite server/

URL does not seem to be working any longer. Mirror down?

http://mirrors.servercentral.net/fedora/epel/6/x86_64/

Hi Steven,
The mirror seems to have changed since this article was originally published. I've updated this article with a different mirror and a link to the list of EPEL mirrors. Please let us know if you have any new issues with the mirror.

I'm having trouble with the new mirror list, but it may be operator error. Can you check on it?

And if you have any advice on building the URLs, or finding out the labels the mirrors use, I'd appreciate it.
It seems like different places use different schemes.

Here is a newer link for the repo itself:
http://dl.fedoraproject.org/pub/epel/6/x86_64/

And this link seems to be the latest for the mirror list:
http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/

Hi, what about adding a third-party repository that uses an authenticated URL string? I'm trying to add the HP firmware for Proliant repository that requires a subscription oto access. Once I obtain a "token", I put it into the URL like this:
http://TOKEN:null@downloads.linux.hp.com/SDR/repo/fwpp

If I paste that into my browser, I can get into the repository. I can get it to connect using wget going through our proxy. When I try adding it into a repository in the Satellite, It won't connect. We have the satellite set up to use the proxy also.

Repo URL: http://{edited_out_the_token)@downloads.linux.hp.com/SDR/repo/fwpp/rhel/6/x86_64/current
ERROR: Cannot retrieve repository metadata (repomd.xml) for repository: fwpp_rhel6. Please verify its path and try again

I am able to set up repositories using the other HP urls that are non-authenticated like the Service Pack repo:
http://downloads.linux.hp.com/SDR/repo/spp/RHEL/6Server/x86_64/current/

Sync started: Mon Jul 6 15:38:31 2015
['/usr/bin/spacewalk-repo-sync', '--channel', 'hp_spp_rhel6', '--type', 'yum']
Repo URL: http://downloads.linux.hp.com/SDR/repo/spp/RHEL/6Server/x86_64/current/
Packages in repo: 704
No new packages to sync.
Repo http://downloads.linux.hp.com/SDR/repo/spp/RHEL/6Server/x86_64/current/ has 0 errata.
Sync completed.

We don't use the Satellite Web-UI so we are unable to complete these steps.

Where is the instructions for Satellite 6.2?

No option on Satellite UI referenced in solution, i.e.: "Go to the Satellite Web-UI through browser, then select Channels => Manage Software Channels. Here you can see create new channel link. Click on that."

No "Channels" option.

** Disclaimer: I'm a Centrify Employee ** We just got an inquiry about this article in our community. Adding the URL for completenes: https://community.centrify.com/t5/Centrify-Infrastructure-Services/what-is-repo-centrify-com/m-p/34269#M2671

Just in case the URL is scrubbed from the comment, some quick hits: - Centrify offers Yum, APT, Zypper and wget repos. - The goal is to facilitate the installation of Centrify assets in containers and systems. - The repo is authentiated with encrypted credentials that are provided to Centrify customers via the Customer Support Portal > Download Center > Repos - Tip: Always validate the client in your environment when a new version is out. The frameworks (PAM, NSS or Kerberos) may change as OS vendor make improvements. Search for "all supported platforms - Centrify" in your favorite search engine to validate support.