1、挂载光盘
mount /dev/cdrom /mnt
2、安装VSFTP服务、createrepo软件包
rpm -ivh vsftpd-2.0.5-24.el5.x86_64.rpm
rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
3、拷贝光盘内容
cp -a /mnt/* /var/ftp/pub/
4、创建YUM仓库
cd /var/ftp/pub/
createrepo .
createrepo报错如下的解决办法
解决方法:
[[email protected] ~]# vi /usr/share/createrepo/genpkgmetadata.py
#!/usr/bin/python2.4 --修改python -t 为 pthhon2.4
5、启动FTP服务
service vsftpd start
chkconfig vsftpd on
客户端使用yum源方法:
[[email protected] yum.repos.d]# pwd
/etc/yum.repos.d
[[email protected] yum.repos.d]# cat local.repo
[Server]
name=Red Hat Enterprise Linux 5
baseurl=ftp://192.168.120.58/pub/Server
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.120.58/pub/RPM-GPG-KEY-redhat-release
[VT]
name=Red Hat Enterprise Linux 5
baseurl=ftp://192.168.120.58/pub/VT
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.120.58/pub/RPM-GPG-KEY-redhat-release
[Cluster]
name=Red Hat Enterprise Linux 5
baseurl=ftp://192.168.120.58/pub/Cluster
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.120.58/pub/RPM-GPG-KEY-redhat-release
[ClusterStorage]
name=Red Hat Enterprise Linux 5
baseurl=ftp://192.168.120.58/pub/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.120.58/pub/RPM-GPG-KEY-redhat-release
测试 yum list!ok