1. 先有一台支持httpd的机器。
2. 在这台机器上建立一个目录software,并把aa配置为虚拟目录。
3. 把所有的软件上传到这个目录下,并运行./createrepo
4. 运行上述命令后会在这个目录下生成一个目录。此时yum源创建成功。
5. 用yum源的时候,现在机器上的/etc/yum.repos.d,在里面配置以下内容:
#vi /etc/yum.repos.d/base.repo
6. 既可以在此台机器上用yum install mysql 安装软件了,哈哈哈
源服务器:repos
#cd /var/www/html
#mkdir software
#cd software
测试该目录是否可以通过web访问,把软件包放到这个目录
#yum install createrepo
#createrepo .
客户机:
忽略i386的包
vi /etc/yum.conf
加入exclude=*i386*
#vi /etc/yum.repos.d/base.repo
输入以下内容:
[base]
name=repos for rhn
baseurl=http://repos/software
gpgcheck=0
enabled=1
#yum clean all
#yum install php*
#yum install --enablerepo=base php*