Centos7.2.1511使用yum出现【No more mirrors to try】问题解决

1、问题分析

该问题出现的原因是现有安装的yum源访问不到资源,所以需要切换源内容。

2、解决问题

1、问题出现内容

使用yum时,出现如下内容

Loaded plugins: fastestmirror
base                                                                                                                                                           | 3.6 kB  00:00:00     
http://yum.tbsite.net/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/



 One of the configured repositories failed (Extra Packages for Enterprise Linux 7 - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable epel

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=epel.skip_if_unavailable=true

failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try.
http://yum.tbsite.net/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

2、查看centos7.2系统本身所安装的yum依赖包

[root@iZza905yczvb7f24vrvsziZ centos]# rpm -qa|grep yum
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-132.el7.centos.0.1.noarch
yum-plugin-fastestmirror-1.1.31-34.el7.noarch

3、卸载这些软件包

[root@iZza905yczvb7f24vrvsziZ centos]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
[root@iZza905yczvb7f24vrvsziZ centos]# rpm -e yum-3.4.3-132.el7.centos.0.1.noarch --nodeps
[root@iZza905yczvb7f24vrvsziZ centos]# yum -e yum-plugin-fastestmirror-1.1.31-34.el7.noarch --nodeps

4、进入centos镜像网站找到自己对应系统需要的yum包

查看系统版本:

[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 

5、查看系统的位数

[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa7ff68f13de25936a098016243ce57c3c982e06, stripped

6、下载并安装yum依赖包

1) 下载

wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm

2) 安装

[root@iZza905yczvb7f24vrvsziZ centos]# rpm -ivh yum-*
Preparing...                          ################################# [100%]
Updating / installing...
   1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 33%]
   2:yum-plugin-fastestmirror-1.1.31-3################################# [ 67%]
   3:yum-3.4.3-132.el7.centos.0.1     ################################# [100%]

7、更新centos系统的repo文件

此repo文件常有更新,可通过以下地址按照版本进行下载:
http://mirrors.163.com/.help/centos.html
在这里插入图片描述

8、删除原来的repo文件

cd /etc/yum.repos.d
rm -rf *.repo

9、拷贝刚才下载的repo文件,到/etc/yum.repos.d目录下

10、运行以下命令生成缓存

[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# yum clean all
yum makecacheLoaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base                                                                                                                                                           | 3.6 kB  00:00:00     
extras                                                                                                                                                         | 2.9 kB  00:00:00     
updates                                                                                                                                                        | 2.9 kB  00:00:00     
(1/10): base/7/x86_64/group_gz                                                                                                                                 | 153 kB  00:00:02     
(2/10): base/7/x86_64/primary_db                                                                                                                               | 6.1 MB  00:00:00     
(3/10): base/7/x86_64/filelists_db                                                                                                                             | 7.2 MB  00:00:02     
(4/10): base/7/x86_64/other_db                                                                                                                                 | 2.6 MB  00:00:00     
(5/10): extras/7/x86_64/primary_db                                                                                                                             | 242 kB  00:00:02     
(6/10): extras/7/x86_64/filelists_db                                                                                                                           | 235 kB  00:00:02     
(7/10): extras/7/x86_64/other_db                                                                                                                               | 143 kB  00:00:00     
(8/10): updates/7/x86_64/primary_db                                                                                                                            | 8.8 MB  00:00:03     
(9/10): updates/7/x86_64/other_db                                                                                                                              | 683 kB  00:00:00     
(10/10): updates/7/x86_64/filelists_db                                                                                                                         | 5.1 MB  00:00:04     
Determining fastest mirrors
Metadata Cache Created
[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 
[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa7ff68f13de25936a098016243ce57c3c982e06, stripped

OK,安装完成

11、测试

[root@iZza905yczvb7f24vrvsziZ yum.repos.d]# yum install vim
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.x86_64 2:7.4.160-1.el7_3.1 will be updated
---> Package vim-enhanced.x86_64 2:7.4.629-8.el7_9 will be an update
--> Processing Dependency: vim-common = 2:7.4.629-8.el7_9 for package: 2:vim-enhanced-7.4.629-8.el7_9.x86_64
--> Running transaction check
---> Package vim-common.x86_64 2:7.4.160-1.el7_3.1 will be updated
---> Package vim-common.x86_64 2:7.4.629-8.el7_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================
 Package                                      Arch                                   Version                                            Repository                               Size
======================================================================================================================================================================================
Updating:
 vim-enhanced                                 x86_64                                 2:7.4.629-8.el7_9                                  updates                                 1.1 M
Updating for dependencies:
 vim-common                                   x86_64                                 2:7.4.629-8.el7_9                                  updates                                 5.9 M

Transaction Summary
======================================================================================================================================================================================
Upgrade  1 Package (+1 Dependent package)

Total download size: 7.0 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): vim-enhanced-7.4.629-8.el7_9.x86_64.rpm                                                                                                                 | 1.1 MB  00:00:02     
(2/2): vim-common-7.4.629-8.el7_9.x86_64.rpm                                                                                                                   | 5.9 MB  00:00:03     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                 2.3 MB/s | 7.0 MB  00:00:03     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 2:vim-common-7.4.629-8.el7_9.x86_64                                                                                                                                1/4 
  Updating   : 2:vim-enhanced-7.4.629-8.el7_9.x86_64                                                                                                                              2/4 
  Cleanup    : 2:vim-enhanced-7.4.160-1.el7_3.1.x86_64                                                                                                                            3/4 
  Cleanup    : 2:vim-common-7.4.160-1.el7_3.1.x86_64                                                                                                                              4/4 
  Verifying  : 2:vim-common-7.4.629-8.el7_9.x86_64                                                                                                                                1/4 
  Verifying  : 2:vim-enhanced-7.4.629-8.el7_9.x86_64                                                                                                                              2/4 
  Verifying  : 2:vim-enhanced-7.4.160-1.el7_3.1.x86_64                                                                                                                            3/4 
  Verifying  : 2:vim-common-7.4.160-1.el7_3.1.x86_64                                                                                                                              4/4 

Updated:
  vim-enhanced.x86_64 2:7.4.629-8.el7_9                                                                                                                                               

Dependency Updated:
  vim-common.x86_64 2:7.4.629-8.el7_9                                                                                                                                                 

Complete!

正常安装完成,没问题。

三、参考连接

1、CentOS镜像使用帮助

2、中科大CentOS 源使用帮助

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值