yum无法下载安装插件

2023-06-29 14:19:19 浏览数 (1)

centos6.4

桥接

网络因为dns连接不通

配置vi /etc/sysconfig/network-scripts/ifcfg-eth0 

配置vi /etc/resolv.conf

重启service network restart

网络ping通后

yum无法下载安装插件

vi /etc/yum.repos.d/CentOS-Base.repo

[base]  

name=CentOS-$releasever - Base  

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os  

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/  

baseurl=http://vault.centos.org/5.11/os/$basearch/  

gpgcheck=1  

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  

#released updates   

[updates]  

name=CentOS-$releasever - Updates  

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates  

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/  

baseurl=http://vault.centos.org/5.11/updates/$basearch/  

gpgcheck=1  

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  

#additional packages that may be useful  

[extras]  

name=CentOS-$releasever - Extras  

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras  

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/  

baseurl=http://vault.centos.org/5.11/extras/$basearch/  

gpgcheck=1  

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  

#additional packages that extend functionality of existing packages  

[centosplus]  

name=CentOS-$releasever - Plus  

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus  

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/  

baseurl=http://vault.centos.org/5.11/centosplus/$basearch/  

gpgcheck=1  

enabled=0  

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  

#contrib - packages by Centos Users  

[contrib]  

name=CentOS-$releasever - Contrib  

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib  

#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/  

baseurl=http://vault.centos.org/5.11/contrib/$basearch/  

gpgcheck=1  

enabled=0  

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

修改文件后,情况yum源缓存:

yum clean all

此外还可以:

yum clean all

rm -f /var/lib/rpm/__db*

rpm –rebuilddb

yum update

试了试不行,干脆把fastestmirror禁掉解决了:

vi /etc/yum/pluginconf.d/fastestmirror.conf

enabled=1改成0

附上fastestmirror插件介绍:

使用yum可以简化系统软件更新的工作。为了保证更新的持续进行,通常都会提供多个mirror(镜像)地址供下载使用,但由于存在地域问题,从不同的镜 像下载速度差异很大。选择从适合的镜像下载软件包,会极大的影响更新速度。

以CentOS为例,可使用一个叫fastestmirror的插件,让yum 在更新时先根据ping值进行判断,然后从最快响应的地址下载。

yum --disableplugin=fastestmirror update

重新安装插件,正确

0 人点赞