yum -y install vim 报错

场景:

dockerfile创建容器时,输入

 yum -y install vim

报错:

Error: Depsolving loop limit reached.
Error: Package: python3-3.6.8-21.el7_9.x86_64 (@updates)
           Requires: python3-libs(x86-64) = 3.6.8-21.el7_9
           Removing: python3-libs-3.6.8-21.el7_9.x86_64 (@updates)
               python3-libs(x86-64) = 3.6.8-21.el7_9
           Updated By: python3-libs-3.6.8-41.el8.x86_64 (base)
               python3-libs(x86-64) = 3.6.8-41.el8
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: rpm = 4.11.3-48.el7_9
           Removing: rpm-4.11.3-48.el7_9.x86_64 (@updates)
               rpm = 4.11.3-48.el7_9
           Updated By: rpm-4.14.3-19.el8.x86_64 (base)
               rpm = 4.14.3-19.el8
Error: Package: perl-Text-Template-1.59-2.el7.noarch (epel)
           Requires: perl(:MODULE_COMPAT_5.16.3)
           Removing: 4:perl-5.16.3-299.el7_9.x86_64 (@updates)
               perl(:MODULE_COMPAT_5.16.3)
           Updated By: 4:perl-5.30.1-452.module_el8.4.0+646+45e06e4a.x86_64 (AppStream)
               Not found
           Obsoleted By: 4:perl-interpreter-5.30.1-452.module_el8.4.0+646+45e06e4a.x86_64 (AppStream)
               Not found
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: librpm.so.3()(64bit)
           Removing: rpm-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpm.so.3()(64bit)
           Updated By: rpm-libs-4.14.3-19.el8.x86_64 (base)
              ~librpm.so.8()(64bit)
Error: Package: 4:perl-Time-HiRes-1.9758-2.el8.x86_64 (AppStream)
           Requires: libperl.so.5.26()(64bit)
           Available: 4:perl-libs-5.26.3-420.el8.x86_64 (base)
               libperl.so.5.26()(64bit)
           Removing: 4:perl-libs-5.16.3-299.el7_9.x86_64 (@updates)
               Not found
           Updated By: 4:perl-libs-5.30.1-452.module_el8.4.0+646+45e06e4a.x86_64 (AppStream)
              ~libperl.so.5.30()(64bit)
           Available: 4:perl-libs-5.24.4-404.module_el8.1.0+229+cd132df8.x86_64 (AppStream)
              ~libperl.so.5.24()(64bit)
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: librpmio.so.3()(64bit)
           Removing: rpm-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpmio.so.3()(64bit)
           Updated By: rpm-libs-4.14.3-19.el8.x86_64 (base)
              ~librpmio.so.8()(64bit)
Error: Package: kernel-3.10.0-1160.114.2.el7.x86_64 (@updates)
           Requires: /usr/sbin/new-kernel-pkg
           Removing: grubby-8.28-26.el7.x86_64 (@anaconda)
               Not found
           Updated By: grubby-8.40-42.el8.x86_64 (base)
               Not found
Error: Package: libidn2-2.3.7-1.el7.x86_64 (epel)
           Requires: libunistring.so.0()(64bit)
           Removing: libunistring-0.9.3-9.el7.x86_64 (@anaconda)
               libunistring.so.0()(64bit)
           Updated By: libunistring-0.9.9-3.el8.x86_64 (base)
              ~libunistring.so.2()(64bit)
Error: Package: systemd-sysv-219-78.el7_9.9.x86_64 (@updates)
           Requires: systemd = 219-78.el7_9.9
           Removing: systemd-219-78.el7_9.9.x86_64 (@updates)
               systemd = 219-78.el7_9.9
           Obsoleted By: systemd-239-51.el8_5.2.x86_64 (base)
               systemd = 239-51.el8_5.2
           Updated By: systemd-239-51.el8_5.2.x86_64 (base)
               systemd = 239-51.el8_5.2
           Available: systemd-239-51.el8.i686 (base)
               systemd = 239-51.el8
Error: Package: python3-devel-3.6.8-21.el7_9.x86_64 (@updates)
           Requires: python3-libs(x86-64) = 3.6.8-21.el7_9
           Removing: python3-libs-3.6.8-21.el7_9.x86_64 (@updates)
               python3-libs(x86-64) = 3.6.8-21.el7_9
           Updated By: python3-libs-3.6.8-41.el8.x86_64 (base)
               python3-libs(x86-64) = 3.6.8-41.el8
Error: Package: python-libs-2.7.5-94.el7_9.x86_64 (@updates)
           Requires: libreadline.so.6()(64bit)
           Removing: readline-6.2-11.el7.x86_64 (@anaconda)
               libreadline.so.6()(64bit)
           Updated By: readline-7.0-10.el8.x86_64 (base)
              ~libreadline.so.7()(64bit)
Error: Package: deltarpm-3.6-3.el7.x86_64 (@base)
           Requires: librpmio.so.3()(64bit)
           Removing: rpm-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpmio.so.3()(64bit)
           Updated By: rpm-libs-4.14.3-19.el8.x86_64 (base)
              ~librpmio.so.8()(64bit)
Error: Package: deltarpm-3.6-3.el7.x86_64 (@base)
           Requires: librpm.so.3()(64bit)
           Removing: rpm-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpm.so.3()(64bit)
           Updated By: rpm-libs-4.14.3-19.el8.x86_64 (base)
              ~librpm.so.8()(64bit)
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: librpmbuild.so.3()(64bit)
           Removing: rpm-build-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpmbuild.so.3()(64bit)
           Updated By: rpm-build-libs-4.14.3-19.el8.x86_64 (base)
              ~librpmbuild.so.8()(64bit)
Error: Package: audit-libs-python-2.8.5-4.el7.x86_64 (@base)
           Requires: audit-libs(x86-64) = 2.8.5-4.el7
           Removing: audit-libs-2.8.5-4.el7.x86_64 (@anaconda)
               audit-libs(x86-64) = 2.8.5-4.el7
           Updated By: audit-libs-3.0-0.17.20191104git1c2f876.el8.x86_64 (base)
               audit-libs(x86-64) = 3.0-0.17.20191104git1c2f876.el8
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: liblua-5.1.so()(64bit)
           Removing: lua-5.1.4-15.el7.x86_64 (@anaconda)
               liblua-5.1.so()(64bit)
           Updated By: lua-5.3.4-12.el8.x86_64 (AppStream)
               Not found
Error: Package: python-libs-2.7.5-94.el7_9.x86_64 (@updates)
           Requires: libgdbm.so.4()(64bit)
           Removing: gdbm-1.10-8.el7.x86_64 (@anaconda)
               libgdbm.so.4()(64bit)
           Updated By: 1:gdbm-1.18-1.el8.x86_64 (base)
               Not found
Error: Package: dracut-network-049-191.git20210920.el8.x86_64 (base)
           Requires: (NetworkManager >= 1.20 or dhclient)
Error: Package: kernel-3.10.0-1160.el7.x86_64 (@anaconda)
           Requires: /usr/sbin/new-kernel-pkg
           Removing: grubby-8.28-26.el7.x86_64 (@anaconda)
               Not found
           Updated By: grubby-8.40-42.el8.x86_64 (base)
               Not found
Error: Package: rpm-python-4.11.3-48.el7_9.x86_64 (@updates)
           Requires: librpmsign.so.1()(64bit)
           Removing: rpm-build-libs-4.11.3-48.el7_9.x86_64 (@updates)
               librpmsign.so.1()(64bit)
           Updated By: rpm-build-libs-4.14.3-19.el8.x86_64 (base)
              ~librpmsign.so.8()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决办法:

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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值