Mbm329 05:21, March 12, 2012 (UTC)
Setup Repository on Central Server (Server)
- Ensure you have enough space in a location to hold the ISO image
$ df -P /var/downloads Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/vg00-dnld 5063712 141248 4665236 3% /var/downloads
- Download latest ISO image
- Mount the ISO via loopback device to mountpoint under a webserver document-root.
# mkdir -p /var/www/html/rhel_repos/5.5/x86_64/base/RPMS # 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 # mount /var/www/html/rhel_repos/5.5/x86_64/base/RPMS
- Create directories to store updates to packages for patching and revision updates
# 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
# 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
# createrepo /var/www/html/rhel_repos/5.5/x86_64/updates/RPMS # createrepo /var/www/html/rhel_repos/5.5/x86_64/local/RPMS
Point yum to repository on nodes (Client)
- Create repo config for yum to use
# cat <<-EOF >/etc/yum.repos.d/rhel.repo [base] name=base baseurl=http://example.server.com/rhel_repos/5.5/$basearch/base enabled=1 gpgcheck=0 [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
# yum clean all
- Check to see if the repository shows up in the list of repos
# yum repolist
- Check to see if packages show up in repository properly
# yum list available