项目中大量使用CentOS5作为运行平台,测试需要经常安装系统,每次要升级的文件越来越多,构建内部仓库一来方便安装,二来方便升级。。。
---
[服务端]
创建基本仓库,并copy DVD或者CD文件(减少网络下载量)
Copy the RPMs from the CDs/DVD to /var/www/html/centos/5/base.
1. mount -o loop,ro CentOS-xxxxx.iso /mnt
2. cp -r /mnt /var/www/html/centos/5/base
同步远端仓库
3./usr/bin/rsync -avrt --delete rsync://rsync.muug.mb.ca/centos/5/os/i386/ /var/www/html/centos/5/os/i386/



同步update仓库
例子:
/usr/bin/rsync -avrt rsync://rsync.muug.mb.ca/centos/5/updates/i386/ /opt/repos/yum/centos/5/updates/i386/

镜像在这里的列表中选中快的
http://www.centos.org/modules/tinycontent/index.php?id=30



客户端使用仓库

[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.xx.xx/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates

[update]
name=CentOS-$releasever - Updates
baseurl=http://192.168.xx.xx/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5