How-To : Setup a Local Mirror of RedHat 7.3

Description :

I originally wanted a local copy of all errata from RedHat. I originally felt I should mirror from a RedHat mirror, but found that they typically sync only once a week. I decided I didn't want to leave my machine with gaping security holes, for a week, while waiting for the mirror to update. As such I found a way to get the updates with in days... if not sooner.

The major flaw with this method is the fact that RedHat limits FTP connections, and as such it may take time for their server to free up before you can download the updates. In general I've had great success with this method and highly recommended.

Please be kind though and don't hammer RedHat's FTP servers. I would recommend this method as the most extreme. If you try to hit them more than once a day, you will likely get them upset.

References :

Mirror : http://sunsite.org.uk/packages/mirror/
Redhat : http://www.redhat.com
ftp://updates.redhat.com
ftp://ftp.redhat.com/pub


Outline :


Procedure :

Install Mirror

  1. Download rpm from ftp://rpmfind.net/linux/contrib/noarch/noarch/mirror-2.9-7.noarch.rpm
  2. At prompt:
    rpm -ivh mirror-2.8.7.noarch.rpm

Config Mirror

  1. Go to the folder where you will want to store the config file.
  2. Type:
    vi redhat.mirror.ftp
  3. Paste the following into the edit:
    package=updates73
    comment=Red Hat Updates - Main - 7.3
    site=ftp.redhat.com
    remote_dir=/pub/redhat/linux/updates/7.3/en/os/i386/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/i386/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/i386/
    max_delete_files=50%
    make_bad_symlinks=true
    update_log=mirror.log

    package=noarch73
    comment=Red Hat Updates - No Arch - 7.3
    site=ftp.redhat.com
    remote_dir=/pub/redhat/linux/updates/7.3/en/os/noarch/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/noarch/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/noarch/
    max_delete_files=50%
    make_bad_symlinks=true
    update_log=mirror.log

    package=kernel73
    comment=Red Hat Updates - Kernel Updates - 7.3
    site=ftp.redhat.com
    remote_dir=/pub/redhat/linux/updates/7.3/en/os/i686/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/i686/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/i686/
    max_delete_files=99%
    make_bad_symlinks=true
    update_log=mirror.log

  4. Now edit this file, changing "/the/path/you/choose/..." with where you want the files to be stored.
  5. Save and close the document when done.
  6. Type:
    vi redhat.mirror.updates
  7. Paste the following into the edit:
    package=updates73
    comment=Red Hat Updates - Main - 7.3
    site=updates.redhat.com
    remote_dir=/7.3/en/os/i386/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/i386/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/i386/
    max_delete_files=99%
    make_bad_symlinks=true
    update_log=mirror.log

    package=noarch73
    comment=Red Hat Updates - No Arch - 7.3
    site=updates.redhat.com
    remote_dir=/7.3/en/os/noarch/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/noarch/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/noarch/
    max_delete_files=99%
    make_bad_symlinks=true
    update_log=mirror.log

    package=kernel73
    comment=Red Hat Updates - Kernel Updates - 7.3
    site=updates.redhat.com
    remote_dir=/7.3/en/os/i686/
    local_dir=/the/path/you/choose/redhat/linux/updates/7.3/en/os/i686/
    mode_copy=true
    do_deletes=true
    save_deletes=true
    save_dir=/the/path/you/choose/redhat/linux/archive/7.3/en/os/i686/
    max_delete_files=99%
    make_bad_symlinks=true
    update_log=mirror.log

  8. Now edit this file, changing "/the/path/you/choose/..." with where you want the files to be stored.
  9. Save and close the document when done.
  10. The config files are fairly self-explanitory and are customized easily. You can actually setup mirroring for any version of RedHat.

Setup the Cron Job

  1. Become root (if thats how you want the cron run... or whatever user) and type:
    crontab -e
  2. This should open up the current crontab. You'll want to add the following to the crontab:
    0 1 * * * /usr/bin/mirror /the/path/you/choose/redhat.mirror.ftp 2>&1 | logger -p local4.info -t redhat-mirror-ftp
    0 4 * * * /usr/bin/mirror /the/path/you/choose/redhat.mirror.updates 2>&1 | logger -p local4.info -t redhat-mirror-updates
  3. Save and close like you would a normal vi session ":wq".
  4. This will run the "redhat.mirror.ftp" file at 1am and "redhat.mirror.updates" at 4am. Sometimes one server is busy and the other is not. If both are available, it will not need to download anything from the second server.

Last Modified :
6-23-2003 : Created Document

If you feel information is missing... please email me.
If you feel I have missed giving credit to a person or organization... please email me.
Copyright © 2003-2012 - Dave Breiland (superdave@dynamicis.com)