服务器端配置
挂载iso cd1 和cd2
mkdir /tmp/cd{1,2} mount /home/share/cd1.iso /tmp/cd1 mount /home/share/cd2.iso /tmp/cd2 mkdir /var/www/html/yum/Centos6.4_x64 -p rsync -av /tmp/cd1/ /var/www/html/yum/Centos6.4_x64/ rsync -av /tmp/cd2/ /var/www/html/yum/Centos6.4_x64/
find /var/www/html/yum/Centos6.4_x64/ |grep comps.xml
拷贝 xxxxxx.comps.xml /var/www/html/yum/Centos6.4_x64/grouplist.xml
cd /var/www/html/yum/Centos6.4_x64/ createrepo -g grouplist.xml ./ vi CentOS6.4-x86_64.repo [CentOS6.4] name=CentOS-$releasever - Base baseurl=http://192.168.x.x/yum/Centos6.4_x64 gpgcheck=0 enabled=1
chmod -w -R /var/www/html/yum/Centos6.4_x64/
httpd.conf
Alias "/yum" "/var/www/html/yum/" <Directory "/var/www/html/yum/"> Order allow,deny Allow from all </Directory>
service httpd restart
客户端时候
mkdir /etc/yum.repos.d/bak for i in `ls /etc/yum.repos.d/|grep -v bak`;do mv $i /etc/yum.repos.d/bak; done
wget http://192.168.x.x/yum/Centos6.4_x64/CentOS6.4-x86_64.repo -O /etc/yum.repos.d
yum clean all
yun list
yun grouplist
yum search "xxx"
后续继续推出第三方软件的本地yum源的设置
本文出自 “活着意味着一切” 博客,谢绝转载!
原文地址:http://51cliang.blog.51cto.com/851508/1431275