【运行报错】Centos 6 无法使用 yum

1. 报错信息:

在使用docker构建mysql容器时,发现无法使用yum安装mysql-server

[root@fd729b2ea367 /]# yum -y install mysql mysql-server
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
 * epel: dl.fedoraproject.org
Package mysql-community-client-5.7.36-1.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.36-1.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.36-1.el6 for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.7.35-1.el6 will be updated
---> Package mysql-community-common.x86_64 0:5.7.36-1.el6 will be an update
---> Package mysql-community-server.x86_64 0:5.7.36-1.el6 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.7.36-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libaio.so.1(LIBAIO_0.1)(64bit)
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libnuma.so.1(libnuma_1.2)(64bit)
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libnuma.so.1()(64bit)
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libnuma.so.1(libnuma_1.1)(64bit)
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libaio.so.1()(64bit)
Error: Package: mysql-community-server-5.7.36-1.el6.x86_64 (mysql57-community)
           Requires: libaio.so.1(LIBAIO_0.4)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

2. 原因分析:

  1. 我这次测试使用的docker镜像是,网易云提供的基础 centos 镜像,该版本是 centos:6.7

    	https://c.163yun.com/hub#/library/repository/info?repoId=1055
    
    	FROM hub.c.163.com/public/centos:6.7
    
  2. CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life),官方便在12月2日正式将CentOS 6相关的软件源移出了官方源,随之而来逐级镜像也会陆续将其删除。

  3. 不过有一些老设备依然需要维持在当前系统,CentOS官方也给这些还不想把CentOS 6扔进垃圾堆的用户保留了各个版本软件源的镜像,只是这个软件源不会再有更新了

3. 解决方法:

复制运行以下代码:

sed -i “s|enabled=1|enabled=0|g” /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值