1.安裝httpd 和 createrepo
yum install httpd createrepo
2.拷貝相關文件
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
mkdir -p /var/www/html/yum.repo/centos/5/os/x86_64/RPMS
mkdir -p /var/www/html/yum.repo/centos/5/updates
mkdir -p /var/www/html/yum.repo/tools
cp -R /mnt/cdrom/CentOS/* /var/www/html/yum.repo/centos/5/os/x86_64/RPMS
cp -R /mnt/cdrom/repodata /var/www/html/yum.repo/centos/5/os/i386/
cp -R /mnt/cdrom/RPM-GPG-KEY-CentOS-5 /var/www/html/yum.repo/
3.創(chuàng)建yum源 索引
createrepo /var/www/html/yum.repo/centos/5/os/x86_64
createrepo /var/www/html/yum.repo/centos/5/updates/x86_64/
createrepo /var/www/html/yum.repo/tools
添加rpm包后修改索引
createrepo --update /var/www/html/yum.repo/tools
4. 客戶端修改vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.1.222/yum.repo/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://192.168.1.222/yum.repo/RPM-GPG-KEY-CentOS-5
#released updates
#[updates]
#name=CentOS-$releasever - Updates
#baseurl=http://192.168.1.222/yum.repo/centos/$releasever/updates/$basearch/
#gpgcheck=1
#gpgkey=http://192.168.1.222/yum.repo/RPM-GPG-KEY-CentOS-5
[tools]
name=CentOS-$releasever - Tools
baseurl=http://192.168.1.222/yum.repo/tools/
gpgcheck=0
enabled=1
5. 客戶端運行 yum makecache
億恩科技地址(ADD):鄭州市黃河路129號天一大廈608室 郵編(ZIP):450008 傳真(FAX):0371-60123888
聯(lián)系:億恩小凡
QQ:89317007
電話:0371-63322206 本文出自:億恩科技【1tcdy.com】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|