Fedora Core8安裝完畢後,一定要做的事情就是:使用yum來更新.添加yum更新源,系統自帶的更新奇慢無比,根本沒有完成的可能.
這裡介紹的是使用httpd方法
安裝httpd軟件包:
#yum install httpd
#chkconfig httpd on
#service httpd start or #/etc/init.d/httpd start
接著安裝createrepo工具包:
#yum install createrepo
然後創建fedora8的軟件包目錄和更新軟件包目錄:
#mkdir -p /var/www/html/yum/base/8/i386
#mkdir -p /var/www/html/yum/updates/8/i386
如果有光盤的話,復制所有的rpm軟件包到/var/www/html/yum/base/8/i386目錄裡:
#cd /misc/cd/Packages;cp -V * /var/www/html/yum/base/8/i386
#cd
或者去http://mirrors.fedoraproject.org/mirrorlists/publiclist/Fedora/8這裡找一個鏡像點,然後用rsync來下載;例:
rsync -avrt rsync://ftp-stud.hs-esslingen.de/fedora/linux/releases/8/Everything/i386/os/Packages/ /var/www/html/yum/base/8/i386
注意上面紅色部分一定要是'/'符號;
下來運行createrepo命令:
# 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
感謝原文作者 Jacky.lee's Favorites