Howto Mirror a Redhat rhn software channel with mrepo

2016/10/30 12:24
1/6
Howto Mirror a Redhat rhn software channel with mrepo
Howto Mirror a Redhat rhn software channel
with mrepo
Install Software
The folowing software needs to be installed before we can proceed with the configuration
Install mrepo
Mrepo is in the epel or the rpmforge repository, choose the epel repository to be safe.
yum install -y mrepo
Install Apache
Apache comes from the base channel
yum intall -y httpd
Install Lftp
Lftp is needed by mrepo for file transfers
yum install -y lftp
Configure the Software
Configure mrepo
vi /etc/mrepo.conf
### Configuration file for mrepo
### The [main] section allows to override mrepo's default settings
### The mrepo-example.conf gives an overview of all the possible settings
[main]
srcdir = /var/mrepo
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386
BIS_Wiki - http://wiki.bsdserver.nl/
Last update: 2014/06/05 10:55
linux:mrepomirror http://wiki.bsdserver.nl/doku.php?id=linux:mrepomirror
shareiso = yes
mailto = [email protected]
smtp-server = mail.example.com
rhnlogin = <your-rhn-user-name>:<your-rhn-password>
lftp-commands = set hftp:use-head 0
###
###
###
###
Any other section is considered a definition for a distribution
You can put distribution sections in /etc/mrepo.conf.d/
Examples can be found in the documentation at:
/usr/share/doc/mrepo-0.8.7/dists/.
[rhel-server-5-x86_64]
name = Red Hat Advanced Server $release ($arch)
release = 5
arch = x86_64
metadata = repomd
iso = rhel-server-5.8-x86_64-dvd.iso
updates = rhns:///rhel-x86_64-server-5
#rhel-x86_64-server-vt-5 = rhns:///rhel-x86_64-server-vt-5
### Fedora EPEL packages (incompatible with RPMforge)
epel = http://ftp.nluug.nl/pub/os/Linux/distr/fedora-epel/$release/$arch
postgres = http://yum.postgresql.org/9.1/redhat/rhel-5.0-$arch/
[rhel-server-5-i386]
name = Red Hat Advanced Server $release ($arch)
release = 5
arch = i386
metadata = repomd
iso = rhel-5.2-server-i386-dvd.iso
updates = rhns:///rhel-i386-server-5
#rhel-i386-server-vt-5 = rhns:///rhel-i386-server-vt-5
### Fedora EPEL packages (incompatible with RPMforge)
epel = http://ftp.nluug.nl/pub/os/Linux/distr/fedora-epel/$release/$arch
Configure Apache
vi /etc/httpd/conf.d/mrepo.conf
### Directory-based for the main server
Alias /mrepo /var/www/mrepo
Alias /yam /var/www/mrepo
<Directory /var/www/mrepo>
Options Indexes FollowSymlinks SymLinksifOwnerMatch IncludesNOEXEC
IndexOptions NameWidth=* DescriptionWidth=*
### Authentication options
http://wiki.bsdserver.nl/
Printed on 2016/10/30 12:24
2016/10/30 12:24
3/6
Howto Mirror a Redhat rhn software channel with mrepo
order allow,deny
Allow from all
#AuthUserFile /var/mrepo/auth/.htpasswd
#Require user bert dag dries thias
HeaderName HEADER.shtml
ReadmeName README.shtml
AddDescription "CDROM ISO file" .iso
AddDescription "RPM packages" .rpm
AddDescription "Yum 1.x header file" .hdr
#
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
"Mounted CDROM ISO" CD[0-9]
"Mounted CDROM ISO" disc[0-9]
"All RPM packages merged" RPMS.all
"Custom local RPM packages" RPMS.local
"OS RPM packages" RPMS.core
"OS RPM packages" RPMS.os
"OS update RPM packages" RPMS.updates
"YaST Online Update RPM packages" RPMS.you
"3rd party RPM packages" RPMS.
"OS source RPM packages" SRPMS
#
#
#
#
AddDescription
AddDescription
AddDescription
AddDescription
"Apt metadata"
"Old-style Yum
"New-style Yum
"Temporary Yum
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"CentOS
"Fedora
"Fedora
"Fedora
"Fedora
"Fedora
#
BIS_Wiki - http://wiki.bsdserver.nl/
base
metadata" headers
metadata" repodata
metadata" .newheaders
2 for x86" centos2-i386
3 for x86" centos3-i386
4 for alpha" centos4-alpha
4 for IA64" centos4-ia64
4 for ppc" centos4-ppc
4 for s/390" centos4-s390
4 for s/390x" centos4-s390x
4 for sparc" centos4-sparc
4 for x86" centos4-i386
4 for x86_64" centos4-x86_64
5 for alpha" centos5-alpha
5 for IA64" centos5-ia64
5 for ppc" centos5-ppc
5 for s/390" centos5-s390
5 for s/390x" centos5-s390x
5 for sparc" centos5-sparc
5 for x86" centos5-i386
5 for x86_64" centos5-x86_64
Core 1 for x86" fc1-i386
Core 1 for x86_64" fc1-x86_64
Core 2 for x86" fc2-i386
Core 2 for x86_64" fc2-x86_64
Core 3 for x86" fc3-i386
Last update: 2014/06/05 10:55
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
#
AddDescription
</Directory>
http://wiki.bsdserver.nl/
linux:mrepomirror http://wiki.bsdserver.nl/doku.php?id=linux:mrepomirror
"Fedora Core 3 for x86_64" fc3-x86_64
"Fedora Core 4 for x86" fc4-i386
"Fedora Core 4 for PPC" fc4-ppc
"Fedora Core 4 for x86_64" fc4-x86_64
"Fedora Core 5 for x86" fc5-i386
"Fedora Core 5 for PPC" fc5-ppc
"Fedora Core 5 for x86_64" fc5-x86_64
"Fedora Core 6 for x86" fc6-i386
"Fedora Core 6 for PPC" fc6-ppc
"Fedora Core 6 for x86_64" fc6-x86_64
"Red Hat Linux 6.2 for x86" rh62-i386
"Red Hat Linux 7.3 for x86" rh73-i386
"Red Hat Linux 8.0 for x86" rh80-i386
"Red Hat Linux 9 for x86" rh9-i386
"Red Hat Advanced Server 2.1 for x86" rhel2.1as-i386
"Red Hat Advanced Server 3 for PPC" rhel3as-ppc
"Red Hat Advanced Server 3 for s/390" rhel3as-s390
"Red Hat Advanced Server 3 for x86" rhel3as-i386
"Red Hat Advanced Server 3 for x86_64" rhel3as-x86_64
"Red Hat Advanced Server 4 for IA64" rhel4as-ia64
"Red Hat Advanced Server 4 for PPC" rhel4as-ppc
"Red Hat Advanced Server 4 for s/390" rhel4as-s390
"Red Hat Advanced Server 4 for x86" rhel4as-i386
"Red Hat Advanced Server 4 for x86_64" rhel4as-x86_64
"Red Hat Advanced Server 5 for IA64" rhel5as-ia64
"Red Hat Advanced Server 5 for PPC" rhel5as-ppc
"Red Hat Advanced Server 5 for s/390" rhel5as-s390
"Red Hat Advanced Server 5 for x86" rhel5as-i386
"Red Hat Advanced Server 5 for x86_64" rhel5as-x86_64
"Red Hat Enterprise Server 3 for x86" rhel3es-i386
"Red Hat Enterprise Server 3 for x86_64" rhel3es-x86_64
"Red Hat Enterprise Server 4 for x86" rhel4es-i386
"Red Hat Enterprise Server 4 for x86_64" rhel4es-x86_64
"Red Hat Enterprise Server 5 for x86" rhel5es-i386
"Red Hat Enterprise Server 5 for x86_64" rhel5es-x86_64
"Red Hat Workstation 3 for x86" rhel3ws-i386
"Red Hat Workstation 3 for x86_64" rhel3ws-x86_64
"Red Hat Workstation 4 for x86" rhel4ws-i386
"Red Hat Workstation 4 for x86_64" rhel4ws-x86_64
"Red Hat Workstation 5 for x86" rhel5ws-i386
"Red Hat Workstation 5 for x86_64" rhel5ws-x86_64
"SuSE Enterprise Server 8 for i386" sles8-i386
"SuSE Enterprise Server 9 for i386" sles9-i386
"Tao Linux 1 for i386" tao1-i386
"Tao Linux 1 for x86_64" tao1-x86_64
"Tao Linux 4 for i386" tao4-i386
"Tao Linux 4 for x86_64" tao4-x86_64
"Yellow Dog Linux 3.0 for PPC" yd3-ppc
"Yellow Dog Linux 4.0 for PPC" yd4-ppc
Printed on 2016/10/30 12:24
2016/10/30 12:24
5/6
Howto Mirror a Redhat rhn software channel with mrepo
### Name based virtual-host named "mrepo"
### """"""""""""""""""""""""""""""""""""
### The purpose of this virtual host is to provide a URL http://mrepo/
### as a standard on your local network and map it to the correct IP
### for the different networks that have access to it.
#
#NameVirtualHost mrepo:80
#
#<VirtualHost mrepo:80>
#
ServerName mrepo
#
ServerAlias mrepo.3ti.be mrepo.localdomain
#
DocumentRoot /var/www/mrepo
#
ErrorLog logs/mrepo-error_log
#
CustomLog logs/mrepo-access_log combined
#</VirtualHost>
Add additional yum repositories
Configure Yum to use the new update repositories
vi /etc/yum.repos.d/mrepo.repo
[rhel-server-5-x86_64-base]
name=Red Hat Advanced Server $release ($arch) Base
baseurl=http://mrepo.example.com/mrepo/rhel-server-5-x86_64/RPMS.os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
[rhel-server-5-x86_64-updates]
name=Red Hat Advanced Server $release ($arch) Updates
baseurl=http://mrepo.example.com/mrepo/rhel-server-5-x86_64/RPMS.updates/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
[rhel-server-5-x86_64-epel]
name=Red Hat Advanced Server $release ($arch) Epel
baseurl=http://mrepo.example.com/mrepo/rhel-server-5-x86_64/RPMS.epel/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
[rhel-server-5-x86_64-postgres]
name=Red Hat Advanced Server $release ($arch) Postgres
baseurl=http://mrepo.example.com/mrepo/rhel-server-5-x86_64/RPMS.postgres/
enabled=1
gpgcheck=0
BIS_Wiki - http://wiki.bsdserver.nl/
Last update: 2014/06/05 10:55
linux:mrepomirror http://wiki.bsdserver.nl/doku.php?id=linux:mrepomirror
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
From:
http://wiki.bsdserver.nl/ - BIS_Wiki
Permanent link:
http://wiki.bsdserver.nl/doku.php?id=linux:mrepomirror
Last update: 2014/06/05 10:55
http://wiki.bsdserver.nl/
Printed on 2016/10/30 12:24