Local 5.5 REPO Mirror

Many software publishers and other organisations maintain servers on the Internet for this purpose, either free of charge or for a subscription fee. Repositories may be solely for particular programs, such as CPAN for the Perl programming language, or for an entire operating system. Operators of such repositories typically provide a package management system, tools intended to search for, install and otherwise manipulate software packages from the repositories. For example, many Linux distributions use Advanced Packaging Tool (APT), commonly found in Debian based distributions or yum, found in Red Hat based distributions.

From a clean install of CentOS 5.5 – with these options: server-gui (or server if you are on a blade/Cloud)
Custom options: In the server section, turn off everything except http

make the dirs

mkdir /var/www/html/centos/5.5/{addons,centosplus,extras,os,updates}/{i386/x86_64}/
ln -s /var/www/html/centos/5.5 /var/www/html/centos/5
#!/bin/sh

rsync="/usr/bin/rsync -avHzP --delete --stats --bwlimit=2000"
#
# choose a good local rsync mirror here!
#
mirror=rsync://mirrors.redhat.list/centos

verlist="5.5"
archlist="i386 x86_64"
baselist="os addons updates centosplus extras"
local=/var/www/html/centos

for ver in $verlist
do
        for arch in $archlist
        do
                for base in $baselist
                do
                        remote=$mirror/$ver/$base/$arch/
                        echo ------------------
                        echo $ver/$base/$arch
                        echo ------------------
                        echo "$rsync $remote $local/$ver/$base/$arch/"

                        if [ ! -e $local/$ver/$base/$arch ]; then
                                echo "Directory does not exist, creating $local/$ver/$base/$arch"
                                mkdir -p "$local/$ver/$base/$arch"
                        fi

                        $rsync $remote $local/$ver/$base/$arch/
                done
        done
done
Go to Top