简单粗暴重新安装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. 详解nohup /dev/null 2>&1 含义的使用

    https://www.jb51.net/article/169837.htm 这篇文章主要介绍了详解nohup /dev/null 2>&1 含义的使用,文中通过示例代码介绍的非常详细 ...

  2. yum是什么?repo文件详解,epel简介,yum源的更换,repo和epel区别

    yum是什么?repo文件详解,epel简介,yum源的更换,repo和epel区别 简单概括: repo和epel的关系 repo是配置源的,即配置从哪里下载包(以及依赖关系)的. epel是作为桥 ...

  3. spring boot热部署 -- 实现 后端java热更新 -- 详细操作 【idea 的 JRebel破解】

    1.前言 上一随笔写了如何使得spring boot热更新前端 ,但后端java部分无法热更新. 对于Java热更新,以前常使用  springloaded  ,但是缺点 和bug很多 无法实现真正意 ...

  4. iview 按需引入解决加载慢的问题

    如果出现加载2s以上的情况请先查看服务器是否对大文件进行过压缩优化处理. 按照官方文档把iview引入到vue的项目中,全部引入的时候没问题.当按官方文档显示的按需加载是借助插件babel-plugi ...

  5. hisql orm 框架insert数据写入教程

    hisql.net 官网(文档编写中) HiSql 源码(github) https://github.com/tansar/HiSql git clone https://github.com/ta ...

  6. 如何使用Github搭建自己的博客

    1.前期准备 sudo apt-get install npm sudo npm install hexo -g 首先使用如下命令创建项目,name是你要创建的博客的名字: hexo init {na ...

  7. 新设备关联Gitlab

    新设备关联Gitlab 1:创建SSH Key.在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsa和id_rsa.pub这两个文件,如果已经有了,可直接跳到下一步.如果 ...

  8. 5.14-HTTP间通信

    1.社长社员通信WEBSOCKET WebSocket 是一种标准协议,用于在客户端和服务端之间进行双向数据传输.但它跟 HTTP 没什么关系,它是一种基于 TCP 的一种独立实现. 以前客户端想知道 ...

  9. 【刷题-LeetCode】207. Course Schedule

    Course Schedule There are a total of numCourses courses you have to take, labeled from 0 to numCours ...

  10. unity3d录音

    using System.Collections; using System.Collections.Generic; using UnityEngine; public class record : ...