CentOS6.8重装yum源详细步骤

6 篇文章 0 订阅
2 篇文章 0 订阅

http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
尝试其他镜像。
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 open a ticket with Red Hat Support.

在这里插入图片描述

为什么要重装yum源

1.CentOS6.8的yum源突然无法使用

yum突然不工作了,也就是挂了 ,我去yum都能挂掉?Linux一切皆文件,我们找到yum的配置文件,刚刚说了我的系统是centos6.8,版本不同可能存在部分差异,根据你自己的情况而定

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

打开以后发现,要来亲命了

baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/

这个镜像站,无法访问了 。。。。,站点不在维护,简直就是坑爹▄█▀█●

http://mirrors.cloud.aliyuncs.com

所以你的yum用不了了,镜像都挂了,你用个锤子。。

2.国内镜像站没有对应的版本下载咋搞?

这是一个很正常的话题,国内知名镜像
网易:http://mirrors.163.com/centos/6.0/
阿里:http://mirrors.aliyun.com/centos/
清华大学:https://mirrors.tuna.tsinghua.edu.cn/
在这里插入图片描述
根本找不到指定的CentOS版本的配件

但是请不要忘记CentOS有官网下载地址
https://vault.centos.org/

在这里插入图片描述
你要的一切,ISO文件,配件等等。。。 都有,关键是还没有被墙掉

删除Python残余和yum残余

1.删除Python残余

为啥要删除,不解释 。。
看操作

首先需要强制删除已安装程序及其关联

rpm -qa|grep python|sudo xargs rpm -ev –allmatches –nodeps

然后删除所有残余文件

whereis python |sudo xargs rm -frv

最后验证是否删除完成,返回无结果表示删除成功

whereis python

2.删除yum残余

删除依赖

rpm -qa|grep yum|sudo xargs rpm -ev –allmatches –nodeps

全局搜索删除

whereis yum |sudo xargs rm -frv

下载Python rpm和yum rpm 和其他配件

都给你列出来了。。 给力把 , 复制到 你的系统,搞个shell 就完了

wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-2.6.6-64.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-devel-2.6.6-64.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-libs-2.6.6-64.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-pycurl-7.19.0-9.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-setuptools-0.6.10-3.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/rpm-python-4.8.0-55.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/updates/x86_64/Packages/libxml2-python-2.7.6-21.el6_8.1.x86_64.rpm

wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-utils-1.1.30-37.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-plugin-protectbase-1.1.30-37.el6.noarch.rpm
wget https://vault.centos.org/centos/6.8/os/x86_64/Packages/yum-plugin-aliases-1.1.30-37.el6.noarch.rpm

在这里插入图片描述

安装Python rpm

至于参数 -ivh 和 -Uvh 的区别 , 这里不解释

rpm -Uvh   python*.rpm

在这里插入图片描述

安装libxml-python 和 安装yum

rpm -ivh libxml2-python-2.7.6-21.el6_8.1.x86_64.rpm 

rpm  -vih yum*.rpm

在这里插入图片描述
不管你有没有装好,反正我的是装好了的。。。。
若你的yum源不可用 。。。

已加载插件:aliases, fastestmirror, protectbase
Determining fastest mirrors

  • base: mirrors.cloud.aliyuncs.com
  • extras: mirrors.cloud.aliyuncs.com
  • updates: mirrors.cloud.aliyuncs.com
    http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
    尝试其他镜像。
    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 open a ticket with Red Hat Support.

下面是解决方案

curl -o /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.odata.cc/repo/Centos-6.repo
curl -o /etc/yum.repos.d/epel.repo http://file.kangle.odata.cc/repo/epel-6.repo


yum makecache

为了对比跟你的,我把里面内容贴出来

下面是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 - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/os/$basearch/
        http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/
        http://mirrors.tencentyun.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/updates/$basearch/
        http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/
        http://mirrors.tencentyun.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/extras/$basearch/
        http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/
        http://mirrors.tencentyun.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/centosplus/$basearch/
        http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.tencentyun.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos-vault/6.10/contrib/$basearch/
        http://mirrors.cloud.tencent.com/centos/$releasever/contrib/$basearch/
        http://mirrors.tencentyun.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

下面是epel.repo文件内容

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch
        http://mirrors.aliyuncs.com/epel-archive/6/$basearch
        http://mirrors.cloud.tencent.com/epel/6/$basearch
        http://mirrors.tencentyun.com/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch/debug
        http://mirrors.aliyuncs.com/epel-archive/6/$basearch/debug
        http://mirrors.cloud.tencent.com/epel/6/$basearch/debug
        http://mirrors.tencentyun.com/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
 
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel-archive/6/SRPMS
        http://mirrors.aliyuncs.com/epel-archive/6/SRPMS
        http://mirrors.cloud.tencent.com/epel/6/SRPMS
        http://mirrors.tencentyun.com/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0

常见的问题
libpython2.6.so.1.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
python(abi) = 2.6 is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 解决方案就是 , 你重头按照我的来就可以了。。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值