Before you execute the "yum update" command on your Linux clients, you need to tell him where to get the update packages, this is done by editing the yum.conf file, one of my Fedora boxes has a configuration that looks like this:
[main] cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=fedora-release tolerant=1 exactarch=1 gpgcheck=1 [local-repository] name=Fedora Core $releasever - $basearch - Released Updates baseurl=ftp://192.168.200.1/pub/linux/fedora/$releasever/updates/
The parameter "baseurl" tells where yum will get the files, 192.168.200.1 is the IP Address of my local repository. Now I can issue the command below to update the system:
# yum update
If you want to learn more about yum commands check this article by Thomas Chung. To use yum on repository machine apply the same configuration above but changing the "baseurl" parameter on yum.conf file, this will make yum search for package updates on the hard disk without network connection:
baseurl=file:///var/ftp/pub/linux/fedora/$releasever/updates/
Wget program will generate a lot of messages, thus you can rotate the log using logrotate program that is shipped by default with FC1 and RH distributions. Logrotate has many features, the following configuration will rotate the log every 2Mb and will keep 2 compressed files as history log, see logrotate man page for details:
# Put this code on /etc/logrotate.conf /tmp/yum_repository.log { compress nomail missingok notifempty rotate 2 size 2M }
I think this method is very easy to setup and keep running even when the mirror server is out, if you have any doubts, bugs or comments, feel free to send them to me. Thanks for reading, until next article!