1 放入redhatES5系统盘,将其挂载到/mnt
 cp -R /mnt/Server /var/ftp/Server 
 cp /mnt/RPM-GPG-KEY-redhat-release /var/ftp/Server
 cd /var/ftp/Server
 rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm 

2
 yum -arch /var/ftp/Server 注:即可有出错也可不管
 createrepo /var/ftp/Server

3配置yum.conf
 cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800

[Server]
name=Red Hat
baseurl=ftp://127.0.0.1/Server/
gpgcheck=1
gpgkey=ftp://127.0.0.1/Server/RPM-GPG-KEY-redhat-release



4 运行vsftp服务
service vsftpd restart

5客户端配置:
方法1
在/etc/yum.repos.d/下生成Server.repo文件 注:如果/etc/yum.conf有设置的话优先从yum.conf中查找;
Client:
mkdir -p  /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
touch /etc/yum.repos.d/Server.repo

cat /etc/yum.repos.d/Server.repo 注:yum.conf尾部也加入如下内容,其余不变;

[Server]
name=Red Hat
baseurl=ftp://127.0.0.1/Server/
gpgcheck=1
gpgkey=ftp://127.0.0.1/Server/RPM-GPG-KEY-redhat-release

方法2
修改默认的/etc/rhel-debuginfo.repo 改两处地方(rhel-debuginfo.repo得从/etc/yum.repos.d/backup拷过来)
baseurl=ftp://127.0.0.1/Server/
enabled=1