简单粗暴重新安装yum。

1、查看linux上所有的yum包
# rpm -qa|grep yum
2、逐个卸载,如
# rpm -e yum-plugin-fastestmirror-1.1.31-34.el7.noarch --nodeps
3、查看自己需要的yum包
# cat /etc/redhat-release 查看系统版本
# file /bin/ls 查看系统位数
4、下载yum依赖,地址http://vault.centos.org
wget https://vault.centos.org/7.5.1804/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget https://vault.centos.org/7.5.1804/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget https://vault.centos.org/7.5.1804/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
wget https://vault.centos.org/7.5.1804/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm 5、 更新centos系统的repo文件,首先备份一下,免得误操作 /etc/yum.repos.d/CentOS-Base.repo
# cp CentOS-Base.repo CentOS-Base.repo.backup

我的 CentOS-Base.repo 文件中的配置:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

再依次运行以下命令生成缓存:

[root@zf-test-web01-4 yum.repos.d]# yum clean all
[root@zf-test-web01-4 yum.repos.d]# yum makecache

完事!

Centos7系统使用yum遇到的问题failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.的更多相关文章

  1. [linux]Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more mirrors to try.

    在使用fedora17 系统的yum源的时候出现了例如以下错误: Error: failure: repodata/repomd.xml from fedora: [Errno 256] No mor ...

  2. fedora18 [linux]Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more mirrors to try.

    在使用fedora17 系统的yum源的时候出现了如下错误: Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more ...

  3. Error: failure: repodata/repomd.xml from fedora: [Errno 256] No more mirrors to try.

    记录一个小问题,重新买的linux换yum源的时候一直提示: Error: failure: repodata/repomd.xml ] No more mirrors to try. 一直说那个XM ...

  4. docker安装报错failure: repodata/repomd.xml from mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro

    1.进入 /etc/yum.repos.d 目录下,将所有有关 docker 的 repo 全部删掉 2.重新添加镜像 sudo yum-config-manager --add-repo https ...

  5. CentOS7系统更换YUM Repo源

    CentOS7系统更换YUM Repo源 备份原镜像 sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.re ...

  6. 使用yum安装报错:[Errno 256] No more mirrors to try

    背景:我使用yum方式安装软件时,比如zabbix这种软件,我们在安装时一般都是直接到zabbix官网,按照官方的步骤进行安装,但是有一个问题,官方的服务器不在国内,时常会在安装时导致超时报错.此时解 ...

  7. yum-config-manager YUM安装遭遇: [Errno 256] No more mirrors to try CentOS yum之$releasever和$basearch

    YUM安装遭遇: [Errno 256] No more mirrors to try createrepo 有问题. CentOS yum之$releasever和$basearch分类: 操作系统 ...

  8. Why does yum return error: [Errno 256] No more mirrors to try ?

    https://access.redhat.com/solutions/203603 ISSUE yum update fails with the error : [Errno 256] No mo ...

  9. 利用yum安装时,报错 [Errno 256] No more mirrors to try.

    问题: [root@gg ~]# yum install -y perl-DBD-MySQL  Loaded plugins: product-id, refresh-packagekit, secu ...

随机推荐

  1. SpringBoot 之 多环境切换

    方式一:分开多个配置文件 # /src/main/resources/application.yaml server: port: 8080 spring: profiles: active: dev ...

  2. linux(CentOS7) 之 jdk1.8 下载及安装

    下载 一.百度搜索oracle,进入官网(或直接进入官网https://www.oracle.com) 二.选择 products 下的 java 三.选择Download Java 四.往下翻找到J ...

  3. Python_类型转换

    列表与字符串互相转换 join方法将list转换为string _list = ["a", "b", "c"] # 以".&quo ...

  4. 建造者模式(python)

    建造者模式将复杂对象的构建与其表示分离.建造者模式主要有两个参与者:建造者(builder)和指挥者(director) 来自为知笔记(Wiz)

  5. vim 安装使用 pathogen

    目录 pathogen 是什么? 如何安装? pathogen 是什么? pathogen 一般作为 vim 新手的第一个插件,用来统一管理 vim 插件包. (官方解释)非常容易地管理你的 'run ...

  6. 离线下载第三方Python包

    1.进入Python第三方包下载地(https://pypi.org/)搜索自己需要的包 2.下载需要的包的版本 3.将.whl格式的文件更改为.zip文件,并且解压 4.将解压的2个文件放到Pyth ...

  7. 记一次 .NET 某消防物联网 后台服务 内存泄漏分析

    一:背景 1. 讲故事 去年十月份有位朋友从微信找到我,说他的程序内存要炸掉了...截图如下: 时间有点久,图片都被清理了,不过有点讽刺的是,自己的程序本身就是做监控的,结果自己出了问题,太尴尬了 二 ...

  8. [流畅的Python]第一章数据模型

    这些来自同一家出版社的动物书 像是计算机科学界一盏盏指路明灯 余幼时 初试读 学浅 以为之晦涩难懂 像是老学究咬文嚼字 现在看起来还有些有趣 其实理工男大多都很有趣 这一章介绍了 怎么样去视线一个带有 ...

  9. 【Java】Super

    Super super用于调用父类的属性.方法.构造器,与this相同. super的使用 属性与方法 在子类的方法或构造器中.通过使用"super.属性"或"super ...

  10. JVM完整详解:内存分配+运行原理+回收算法+GC参数等

    不管是BAT面试,还是工作实践中的JVM调优以及参数设置,或者内存溢出检测等,都需要涉及到Java虚拟机的内存模型.内存分配,以及回收算法机制等,这些都是必考.必会技能. JVM内存模型 JVM内存模 ...