RHEL Repo Setup

Mbm329 05:21, March 12, 2012 (UTC)

Setup Repository on Central Server (Server)
$ df -P /var/downloads Filesystem           1024-blocks   Used Available Capacity Mounted on /dev/mapper/vg00-dnld     5063712 141248   4665236       3% /var/downloads
 * Ensure you have enough space in a location to hold the ISO image


 * Download latest ISO image


 * Mount the ISO via loopback device to mountpoint under a webserver document-root.
 * 1) mkdir -p /var/www/html/rhel_repos/5.5/x86_64/base/RPMS
 * 2) echo '/var/downloads/rhel-5.5.iso /var/www/html/rhel_repos/5.5/x86_64/base/RPMS iso9660 loop=/dev/loop0 0 0' >>/etc/fstab
 * 3) mount /var/www/html/rhel_repos/5.5/x86_64/base/RPMS


 * Create directories to store updates to packages for patching and revision updates
 * 1) mkdir -p /var/www/html/rhel_repos/5.5/x86_64/updates/RPMS /var/www/html/rhel_repos/5.5/x86_64/local/RPMS


 * Create a repository one level up from the mountpoint using the repodata group file packaged on the ISO image
 * 1) createrepo -g /var/www/html/rhel_repos/5.5/x86_64/base/RPMS/Server/repodata/comps-rhel5-server-core.xml /var/www/html/rhel_repos/5.5/x86_64/base


 * We do the same for the updates and local repositories, locating the repodata one level higher
 * 1) createrepo /var/www/html/rhel_repos/5.5/x86_64/updates/RPMS
 * 2) createrepo /var/www/html/rhel_repos/5.5/x86_64/local/RPMS

Point yum to repository on nodes (Client)
[base] name=base baseurl=http://example.server.com/rhel_repos/5.5/$basearch/base enabled=1 gpgcheck=0
 * Create repo config for yum to use
 * 1) cat <<-EOF >/etc/yum.repos.d/rhel.repo

[updates] name=updates baseurl=http://example.server.com/rhel_repos/5.5/$basearch/updates enabled=1 gpgcheck=0

[local] name=local baseurl=http://example.server.com/rhel_repos/5.5/$basearch/local enabled=1 gpgcheck=0 EOF


 * Clear any existing metadata on client system
 * 1) yum clean all


 * Check to see if the repository shows up in the list of repos
 * 1) yum repolist


 * Check to see if packages show up in repository properly
 * 1) yum list available