Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
301 lines (220 sloc) 9.05 KB
= Using RHN support in mrepo
Dag Wieers <>
0.8.8svn, 29 august 2011
// Please send me improvements to this document.
This document describes how to set up a Red Hat Network mirror for various
RHEL versions and architectures and provide the packages to local clients.
== Requirements
For RHN support to work, you need to install the up2date package
that comes with your RHEL distribution. It may not work with
another up2date package (eg. Fedora Core).
== RHN systemid creation
For each distribution you want to add to mrepo, you need to have a valid
RHN systemid. You can create a systemid (provided you have the correct
entitlements to do so) by using the gensystemid tool that comes with
mrepo, eg.
gensystemid -r 6Server -a x86_64 /var/mrepo/rhel6s-x86_64
The tool will create a new system called _<hostname>-6Server-x86_64-mrepo_,
register this system on RHN and create a systemid file in
== RHN configuration
Having done that, you can enable multiple channels for this systemid
on the RHN website. And then configure mrepo to use these channels, eg.
name = Red Hat Enterprise Linux Server 6.1 ($arch)
release = 6
arch = i386 x86_64
iso = rhel-server-6.1-$arch-dvd.iso
updates = rhns:///rhel-$arch-server-6
ha = rhns:///rhel-$arch-server-ha-6
lb = rhns:///rhel-$arch-server-lb-6
optional = rhns:///rhel-$arch-server-optional-6
rs = rhns:///rhel-$arch-server-rs-6
supplementary = rhns:///rhel-$arch-server-supplementary-6
After that, mrepo should be able to successfully log on and download
all packages for the configured channels.
== Creating systemids for different dists/archs
Previously it was not possible to generate a new systemid for a
dist/arch without installing a system, connecting it to the Internet
and then register on RHN.
A lot of companies simply do not allow servers to have internet access
and I have personally been several times in the situation that I needed
to download x86_64 or ppc packages for a system that I have entitlements
for but is simply not allowed to connect to the Internet.
The gensystemid tool that comes with mrepo will help you with creating
valid systemids for mrepo, eg.
$ gensystemid -r 4AS -a x86_64 /var/mrepo/rhel4as-x86_64
You can manage your systems on the RHN website afterwards.
WARNING: For yet unknown reasons, you have to be root to run +gensystemid+.
== Downloading from unsubscribed channels
You can let mrepo subscribe to the necessary channels, unfortunately this
requires your RHN username and password. You can provide these in
the main section, like:
rhnlogin = username:password
Or you can supply them to rhnget at the appropriate time. Unfortunately since
+rhnget+ is a seperate tool invoked by mrepo, you may need to provide this
information several times (every time you need to subscribe to a new channel).
You can also choose to only provide the username in _/etc/mrepo.conf_ and
provide the password interactively.
rhnlogin = username
Of course if you put the password in _/etc/mrepo.conf_, you need to protect it.
You may want to do:
$ chmod og= /etc/mrepo.conf
$ chown root.root /etc/mrepo.conf
Since you only need the username/password to subscribe to new channels
(only the very first time you access them) you may wish to remove the
login information from mrepo.conf after that.
You can also log on manually to the RHN website to subscribe your system
to the channels you require.
== Adding up2date-uuid file
If you get the following error:
No rhnuuid config option found in /etc/sysconfig/rhn/up2date-uuid
Then you are missing the file _/etc/sysconfig/rhn/up2date-uuid_, the content
of this file looks similar to:
uuid[comment]=Universally Unique ID for this server
where +rhnuuid+ contains a unique identifier that matches your system. You can
create this file by running:
UUID=$(uuidgen) ; /bin/echo -e "uuid[comment]=Universally Unique ID for this server\nrhnuuid=$UUID" > /etc/sysconfig/rhn/up2date-uuid
== List of RHN channels
For a complete and up-to-date list of available channels, check the RHN
website. Here is a list of what we encountered, please send in more.
RHEL6 Server
RHEL5 Server
rhel-$arch-as-4-hwcert (only for AS)
rhel-$arch-as-3-hwcert (only for AS)
rhel-3-as-i386-rhaps-1 (only for i386)
rhel-3-as-i386-rhds-2 (only for i386)
redhat-advanced-server-i386 (only for AS)
redhat-ent-linux-i386-es-2.1 (only for ES)
Please send me updates on these.
== Ignore packages you already have elsewhere
This is possible, although hard to implement currently. I could check
whether the file exists on one of the ISOs (or in the RPMS/ directory),
but I prefer to implement this after a redesign.
You can simply get the same effect with the following script,
if [ -z "$dists" ]; then
cd $srcdir
cd -
for dist in $dists; do
echo "Cleaning up $dist"
### Remove dangling links
for link in $(find "$srcdir/$dist/updates" -type l); do
if [ ! -r "$(readlink $link)" ]; then
rm -f $link
### Relink existing files
for rpm in $wwwdir/$dist/disc?/RedHat/RPMS/*.rpm; do
file="$(basename $rpm)"
ln -sf "$rpm" "$dstfile"
Run this script when you download new RHEL ISO files and make these available
in mrepo, but before downloading any updates from RHN.
$ mrepo --umount
Then download new ISO files and modify the mrepo config file(s) to reflect
this change. And then do:
$ mrepo -v
$ ./
$ mrepo -uvg
This will free up some space by symlinking duplicate RPM packages from the ISO
files on top of the RPM packages on disk. As a side-effect it will also prevent
the new updates from being downloaded. You can also remove _all_ packages from
the updates repository prior to doing this.
== rhn:// and rhns:// URL schemes
The default scheme for RHN is rhns:// (HTTPS), but it was reported that
in some cases (related to proxies or firewalls) the HTTPS connections
fail, so there is a need to allow for HTTP connections. You can specify
this by using the rhn:// scheme instead of rhns://
In this case, the authentication is not done using SSL either !
== Using Red Hat satellite servers
You can override the hardcoded RHN server by specifying it in the URL.
If it is not specified, mrepo will assume a default value of
So the following two lines are identical:
updates = rhns:///rhel-i386-as-4
updates = rhns://
And you can use a satellite server by doing:
updates = rhns://your.own.satellite/rhel-i386-as-4
== Using a single systemid
You can experiment with using a single systemid for multiple dists
using the +rhnrelease+ directive:
rhnrelease = 3AS
This way you override the OS release that is in the systemid file.
This works across the same entitlement. Eg. when you have an Advanced
Server entitlement, you can download from 2.1AS, 3AS and 4AS channels.
But not from the ES or WS channels and not from different architectures.
== RHN documentation and references
A useful list of RHN references:
kickstart-list: RHN XMLRPC API
RHbz 162210: [RFE] New up2date command-line options
RHbz 179721: [RFE] No documentation for (RHN) up2date XMLRPC API methods
And how to configure mrepo for RHN access:
Installing YAM 0.8.0 on Red Hat Enterprise Linux 4
// vim: set syntax=asciidoc:
Jump to Line
Something went wrong with that request. Please try again.