本文共 1426 字,大约阅读时间需要 4 分钟。
如果使用HTTP做YUM源,具体设置如下:
1 安装httpd安装包 #yum -y install httpd
2 挂载ISO,创建本地更新源
#mount -t iso9660 -o loop rh63.iso /mnt/cdrom
#cd /var/www/html/
#mkdir yum
# mount --bind /mnt/cdrom yum
[root@localhost html]# vi /etc/yum.repos.d/yum.repo
[root@localhost html]# cat /etc/yum.repos.d/yum.repo
[RHEL]
name=rhel6.3
baseurl=http://192.168.1.130/yum/
gpgcheck=0
enabled=1
3 service httpd start #启动httpd守护进程,否则在其他机器上会提示找不到相关源
chkconfig httpd on #设置系统服务
4 测试一下
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
5 报错说无法连接到YUM源
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://192.168.161.1/rh63/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source. Please verify its path and try again
首先确认HTTPD服务启动了没有
service httpd status
并且检查有无防火墙限制,或者关闭防火墙
service iptables stop
其二如果还报无法连接错误
则删除一个认证文件
rm -rf /root/.ssh/known_hosts
再次如果还报验证有错误,则修改/etc/yum.conf文件
把其中的gpgcheck=1改为gpgcheck=0
6 再试试
[root@localhost yum.repos.d]# rpm -qa|grep telnet
[root@localhost yum.repos.d]# yum -y install telnet*
Installed:
telnet.i686 1:0.17-47.el6 telnet-server.i686 1:0.17-47.el6
Dependency Installed:
xinetd.i686 2:2.3.14-34.el6
Complete!
好了,YUM没问题了。
转载地址:http://rpjsa.baihongyu.com/