温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何进行yum的排错

发布时间:2021-12-30 15:37:45 来源:亿速云 阅读:90 作者:柒染 栏目:云计算

本篇文章为大家展示了如何进行yum的排错,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

如果使用HTTP做YUM源,具体设置如下:

1 安装httpd安装包 #yum -y install httpd

2 挂载ISO,创建本地更新源

#mount -t iso9660 -o loop rh73.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/rh73/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没问题了。

上述内容就是如何进行yum的排错,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注亿速云行业资讯频道。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

yum
AI