Linux yum 不能用了,什么原因求解

Linux yum 不能用了,什么原因求解,第1张

网络不通,无法连接到yum源,虚拟机需要连到公网,虚拟机网卡设置为NAT网络,建议设置双网卡,一个设置仅主机host-only网络,配置静态IP,在本地可以通过客户端工具远程;一个设置nat网络地址转换,用来连外网,这样yum可以用了。

禁用掉这个插件就可以用了

禁用这个插件,方法如下:

root@www.sinesafe.com]# vi  /etc/yum/pluginconf.d/fastestmirror.conf

[main]

enabled=0  //把1改为0

verbose=0

socket_timeout=3

hostfilepath=/var/cache/yum/timedhosts.txt

maxhostfileage=10

maxthreads=15

#exclude=.gov, facebook

=======================================================================================

修改以下配置文件

#vi /etc/yum.conf

[main]

cachedir=/var/cache/yum/$basearch/$releasever

keepcache=0

debuglevel=2

logfile=/var/log/yum.log

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1                 #将plugins的值修改为0

installonly_limit=5

我试过了很多方法,有:1、修改DNS配置。我的DNS没有问题,加上了namesever 8.8.8.8后仍然不行。2、更换yum源。我更换了163的yum源和sohu的yum源,仍然无法解决问题。3、修改/etc/yum.repos.d/CentOS-Base.repo中的gpgcheck=1为gpgcheck=1,不起作用。4、将yum卸载(yum remove yum),重新下载yum安装包进行安装,还是出现一样的错误提示。现将yum的配置贴出来:/etc/yum.conf[main]cachedir=/var/cache/yum/$basearch/$releaseverkeepcache=0debuglevel=2logfile=/var/log/yum.logexactarch=1obsoletes=1gpgcheck=1plugins=1installonly_limit=5bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yumdistroverpkg=centos-releaseyum源:/etc/yum.repos.d/CentOS-Base.repo:[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#released updates [updates]name=CentOS-$releasever - Updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contribmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6希望能给予帮助


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7386097.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-05
下一篇 2023-04-05

发表评论

登录后才能评论

评论列表(0条)

保存