how to create a mirror repository for your local lan.
- create a destination folder eg: /var/www/html/repo/
- create subfolders for fedora eg: /var/www/html/repo/f15/x86_64/updates/repodata
- download the files from repository to local folder. i use the following line to copy the files from an official repository, this may take a little time
rsync -av –delete –exclude=debug rsync://mirror.ovh.net/download.fedora.redhat.com/linux/updates/15/x86_64/ /var/www/html/repo/f15/x86_64/updates/repodata/
- create the informations for yum:
createrepo /var/www/html/repo/f15/x86_64/updates/
- configure apache to display the entries from /var/www/html/repo/
- create the repo config on a client /etc/yum.repos.d/fedora-updates-cache.repo
[cache-updates] name=Fedora $releasever – $basearch – Updatesfailovermethod=priority baseurl=http://reposerver.mydomain/repo/f$releasever/$basearch/updates/ enabled=1 gpgcheck=0priority=10
- try to reinstall an application or update
- create a job with crontab to run the rsync command every day
# min hour day month weekday user command # — update cacherepo 00 00 * * * /bin/nice -n 15 /root/scripts/update-repo.sh &>/dev/null
below i uploaded my configs for the daily job to mirror some different repos. this way should also work for centos.
files:
Hello, thanks for sharing this. With this, I can host it using nginx locally, for kickstart purpose. Fedora docs isn’t straight forward, make me confused… tbh.. this is really useful for beginner like me for setup and run. Thanks!