1. 当前CenOS 系统是2.6版本的, 在安装python-requests模块时,报错:

[root@tester pluginconf.d]# uname -a
Linux tester 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

root@tester yum.repos.d]# yum install python-requests -y
Loaded plugins: security
Setting up Install Process
Repository rabbitmq_erlang is listed more than once in the configuration
Repository rabbitmq_erlang-source is listed more than once in the configuration
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn’t help to resolve this issue please use https://bugs.centos.org/.

http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: (28, ‘connect() timed out!’)
Trying other mirror.
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”
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@tester yum.repos.d]#

  1. 百度说 2020年12月2号之后,CentOS 6更新包下架了,导致找不到更新软件而失败。

  2. 备份下面2个文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

  1. 到阿里云上下载CenOS 7的 CentOS-Base.repo文件和

阿里云网址:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11sjf0dJ 下载CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

阿里云网址:https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.3e221b11p0e5G5下载epel.report
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

然后使用vi编辑器,将CentOS-Base.repo文件中$releasever全部改成7, 因为这个参数获得的是当前系统的版本6

cd /etc/yum.repos.d
vi CentOS-Base.repo
:%s/KaTeX parse error: Expected 'EOF', got '#' at position 16: releasever/7/g #̲将文件中releasever全部改成7

  1. 清除缓存:
    [root@tester yum.repos.d]# yum clean all
    [root@tester yum.repos.d]# yum makecache

  2. 再运行yum install python-requsts -y 就可以执行了, 不过最后出现了其它的安装错误,信息如下, 搞不定了

–> Processing Dependency: python(abi) = 2.6 for package: python-iwlib-0.1-1.2.el6.x86_64
—> Package python-libs.x86_64 0:2.6.6-52.el6 will be updated
–> Processing Dependency: libpython2.6.so.1.0()(64bit) for package: python-iwlib-0.1-1.2.el6.x86_64
—> Package upstart.x86_64 0:0.6.5-13.el6_5.3 will be obsoleted
–> Processing Dependency: upstart for package: 1:readahead-1.5.6-2.el6.x86_64
—> Package zabbix-agent.x86_64 0:3.4.15-1.el6 will be an update
–> Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-agent-3.4.15-1.el6.x86_64
–> Processing Dependency: /sbin/new-kernel-pkg for package: kernel-2.6.32-431.23.3.el6.x86_64
–> Restarting Dependency Resolution with new changes.
Error: Depsolving loop limit reached.
Error: Package: python-iwlib-0.1-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: python(abi) = 2.6
Removing: python-2.6.6-52.el6.x86_64 (@updates)
python(abi) = 2.6
Updated By: python-2.7.5-90.el7.x86_64 (updates)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-89.el7.x86_64 (base)
python(abi) = 2.7
python(abi) = 2.7
Available: python3-3.6.8-17.el7.i686 (base)
python(abi) = 3.6
python(abi) = 3.6
Available: python3-3.6.8-18.el7.i686 (updates)
python(abi) = 3.6
python(abi) = 3.6
Available: python34-3.4.10-7.el7.x86_64 (epel)
python(abi) = 3.4
Error: Package: ppl-0.10.2-11.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: libgmp.so.3()(64bit)
Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
libgmp.so.3()(64bit)
Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
Not found
Error: Package: cloog-ppl-0.15.7-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: libgmp.so.3()(64bit)
Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
libgmp.so.3()(64bit)
Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
Not found
Error: Package: hal-info-20090716-3.1.el6.noarch (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: hal >= 0.5.10
Removing: hal-0.5.14-11.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
hal = 0.5.14-11.el6
Obsoleted By: systemd-219-78.el7_9.3.x86_64 (updates)
Not found
Error: Package: 2:postfix-2.10.1-9.el7.x86_64 (base)
Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit)
Available: 1:mariadb-libs-5.5.68-1.el7.x86_64 (base)
libmysqlclient.so.18(libmysqlclient_18)(64bit)
Error: Package: python-iwlib-0.1-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: libpython2.6.so.1.0()(64bit)
Removing: python-libs-2.6.6-52.el6.x86_64 (@updates)
libpython2.6.so.1.0()(64bit)
Updated By: python-libs-2.7.5-90.el7.x86_64 (updates)
Not found
Error: Package: 1:readahead-1.5.6-2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: upstart
Removing: upstart-0.6.5-13.el6_5.3.x86_64 (@updates)
upstart = 0.6.5-13.el6_5.3
Obsoleted By: systemd-219-78.el7_9.3.x86_64 (updates)
Not found
Error: Package: libgcj-4.4.7-4.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
Requires: libgmp.so.3()(64bit)
Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
libgmp.so.3()(64bit)
Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
Not found
Error: Package: 2:postfix-2.10.1-9.el7.x86_64 (base)
Requires: libmysqlclient.so.18()(64bit)
Available: 1:mariadb-libs-5.5.68-1.el7.x86_64 (base)
libmysqlclient.so.18()(64bit)
Error: Package: mysql-community-server-5.7.33-1.el6.x86_64 (mysql57-community)
Requires: libsasl2.so.2()(64bit)
Removing: cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
libsasl2.so.2()(64bit)
Updated By: cyrus-sasl-lib-2.1.26-23.el7.x86_64 (base)
Not found
Error: Package: zabbix-agent-3.4.15-1.el6.x86_64 (zabbix)
Requires: libpcre.so.0()(64bit)
Removing: pcre-7.8-7.el6.x86_64 (@base)
libpcre.so.0()(64bit)
Updated By: pcre-8.32-17.el7.x86_64 (base)
Not found

You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), ‘yum check’ output follows:
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)

重大好消息*: 最终用自己生成的 CentOS-Base.repo , epel.repo 文件,使用搜狐的镜像,可以成功更新了:

(1)先备份原先的 CentOS-Base.repo , epel.repo ,用vi编辑器生成下面内容的两个文件,

[root@tester yum.repos.d]# cat CentOS-Base.repo
[base]
name=CentOS-6
failovermethod=priority
baseurl=https://vault.centos.org/6.9/os/x86_64/
url=http://mirrors.sohu.com/centos/6.10/os/x86_64/
gpgcheck=1

[root@tester yum.repos.d]# cat epel.repo
[epel]
name=sohu-epel
baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[root@tester yum.repos.d]#

(2)然后执行: yum clean all

                      yum makecache

(3) 再执行yum install python-requests -y 安装命令就可以顺利执行完了。

感谢 这些链接的 同学们:

https://blog.51cto.com/hcymysql/2567297 建议用搜狐的源来下载 ,目前过内搜狐的镜像源还有CentOS 6的下载文件。

https://www.xmpan.com/944.html

https://www.cnblogs.com/binbingg/p/14082610.html

https://vault.centos.org/6.9/os/x86_64/

The contents of this directory have been moved to our archives available at:http://archives.fedoraproject.org/pub/archive/epel/     ===这里的镜像源文件可用

If you are having troubles finding something there please stop by #epel on irc.freenode.net

Linux CentOS 6不能使用yum安装命令相关推荐

  1. linux通过yum安装vim,linux/centos系统如何使用yum安装vi/vim?

    linux/centos系统如何使用yum安装vi/vim? yum安装vim最简单的命令, yum -y install vim* 然后就可以使用vi命令了. 网上的文章: 要使用vim, 使用yu ...

  2. linux编译blas,Linux系统CentOS 6.8上yum安装BLAS库

    Linux系统CentOS 6.8上yum安装BLAS库 BLAS是一个广泛应用到科学计算软件上面的库文件,在CentOS的软件库中已经有该软件的软件包,我们可以直接使用yum来安装. 1.1.查询C ...

  3. Linux Centos下SQL Server 2017安装和配置

    Linux Centos下SQL Server 2017安装和配置 原文:Linux Centos下SQL Server 2017安装和配置 我们知道在Linux下安装服务有很多方式,最为简单的也就是 ...

  4. 在Centos 6.x 下yum安装php 5.5

    Centos 6.5默认yum安装的php版本为 5.3,但是现在较多的系统已经对此版本不支持.so,可以以下办法安装较高版本的php 添加Epel源 # rpm -Uvh http://downlo ...

  5. centos 6.2用yum安装中文输入法

    centos 6.2用yum安装中文输入法 1.su root 2.yum install "@Chinese Support" 3.exit 4.回到桌面,system-> ...

  6. CentOS 7.5 使用 yum 安装 Kubernetes 集群(二)

    一.安装方式介绍 1.yum 安装 目前CentOS官方已经把Kubernetes源放入到自己的默认 extras 仓库里面,使用 yum 安装,好处是简单,坏处也很明显,需要官方更新 yum 源才能 ...

  7. linux增加epel源,yum安装nignx,脚本安装mysql服务端,shell脚本监控网站页面

    epel是一种yum仓库,里面提供了更多.更丰富linux软件,但是,它不是默认yum仓库,我们需要手工添加这个yum源. 添加epel源 参考:http://freeloda.blog.51cto. ...

  8. 在CentOS 6上使用yum安装lnmp服务

    zhuanzaidizhi: https://www.qiansw.com/yum-lnmp.html 为了展示linux的简单易用,本文所有使用的应用,全部使用yum安装. 安装CentOS系统 本 ...

  9. centos8编译安装vlc_在CentOS系统中通过yum安装VLC播放器的教程

    鉴于VLC这个播放器的牛X+V5,在windows下用起来确实很安逸,吃过晚饭突然想在CentOS上也安装一个来耍耍.网上搜罗半天,包括VLC官网都没找到对CentOS的指导教程,最接近的就是Fedo ...

  10. Linux CentOS 8中Docker的安装与卸载

    目录 一.安装yum-utils 二.安装前准备 三.Docker仓库 四.Docker版本 五.Docker安装 六.Docker启动 七.Docker卸载 一.安装yum-utils    yum ...

最新文章

  1. 权威预测:2018年这十大数字化转型趋势要火!
  2. iOS 9应用开发教程之创建iOS 9项目与模拟器介绍
  3. android 无法添加依赖关系,Android无法添加aop库依赖
  4. 开了立体声混音仍然不能内录_蓝牙音箱有个功能很鸡肋,用好了秒变HIFI立体声...
  5. Bugku-网站被黑
  6. 第七周 项目2 - 建立链队算法库
  7. SQL Server select 英文区分大小写
  8. android远程主机强迫关闭了一个现有的连接,远程主机强迫关闭了一个现有的连接解决方法...
  9. 苹果计算机做视频教程,Mac版Final Cut Pro x使用技巧及视频教程
  10. GB28181语音对讲/摄像头公网对讲指挥
  11. 微软编程规范(文档)
  12. android 通知栏背景颜色跟随app导航栏背景颜色变化而变化
  13. Android Studio 高德获取经纬度,定位
  14. 认识USB、Type-C、闪电、雷电接口
  15. 推荐个比较好用的协同办公软件,帮助你高效办公
  16. 5、JVM分代模型--新生代 的垃圾回收
  17. Matlab实现电子钢琴
  18. 图像识别的应用与实践
  19. [生存志] 第65节 曾参公西赤
  20. 使用C语言实现汉诺塔问题——递归

热门文章

  1. Hybrid APP混合开发
  2. 梯度、散度、旋度、拉普拉斯算子
  3. 褚霸:不要为了开源而开源
  4. uni-icons在支付宝小程序中图标不显示
  5. 揭秘游戏服务器,不看后悔!!!
  6. 【ML】机器学习(西瓜书)思维导图
  7. 微信接入之获取用户头像
  8. 软件测试思想者 - 再识王阳明
  9. 单片机与嵌入式linux 比较
  10. JVM致命错误日志 hs_err_pid.log的分析