![]() |
|
# createrepo /var/www/html/yum/base/8/i386
这个命令会在/var/www/html/yum/base/8/i386目录里创建一个repodata的文件夹,里面包含了如下几个文件:
#ls -l /var/www/html/yum/base/8/i386/repodata/
total 9268
-rw-r——r—— 1 root root 2227275 2008-01-12 21:11 filelists.xml.gz
-rw-r——r—— 1 root root 6487453 2008-01-12 21:11 other.xml.gz
-rw-r——r—— 1 root root 747714 2008-01-12 21:11 primary.xml.gz
-rw-r——r—— 1 root root 951 2008-01-12 21:11 repomd.xml
接着进入/var/www/html/yum/updates/8/i386目录,在用rsync目录下载最新的rpm软件包:
rsync -avrt rsync://ftp-stud.hs-esslingen.de/fedora/linux/updates/8/i386/ ——exclude=debug/ /var/www/html/yum/updates/8/i386
然后设置一下crontab,使其自动下载最新软件包:
23 4 */2 * * /usr/bin/rsync -avrt
rsync://ftp-stud.hs-esslingen.de/fedora/linux/updates/8/i386/
——exclude=debug/ /var/www/html/yum/updates/8/i386
最后,进入/etc/yum.repos.d/目录里,创建一个以repo为结尾的文件,如下所示:
| [base-local] name=Fedora $releasever - $basearch failovermethod=priority baseurl=http://192.168.0.100/yum/base/$releasever/$basearch #mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch enabled=1 gpgcheck=0 [updates-local] name=Fedora $releasever - $basearch - Updates failovermethod=priority baseurl=http://192.168.0.100/yum/updates/$releasever/$basearch/ #mirrorlist=http://mirrors.fedoraproject.org /mirrorlist?repo=updates-released-f$releasever&arch=$basearch enabled=1 gpgcheck=0 |
[1] [2]