CentOS - yum install - 失败:受保护的 Multilib 版本:发现问题 libselinux
CentOS - yum install - Fails: Protected Multilib versions: problems found libselinux
我有 CentOS 6.5
我正在尝试通过 yum 安装 git,但在安装先决条件包时出现错误。 我不需要,但它不会伤害 运行 使用 root 执行 sudo。
错误信息:
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libselinux.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of libselinux installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.
3. You have duplicate versions of libselinux installed already.
You can use "yum check" to get yum show these errors.
...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).
Protected multilib versions: libselinux-2.0.94-5.3.el6_4.1.i686 != libselinux-2.0.94-5.8.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
完整日志:
[root@server01 ~]# sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package gcc-4.4.7-4.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package expat-devel.x86_64 0:2.0.1-11.el6_2 will be installed
---> Package gettext-devel.x86_64 0:0.17-16.el6 will be installed
--> Processing Dependency: gettext-libs = 0.17-16.el6 for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: gettext = 0.17-16.el6 for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextsrc-0.17.so()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextpo.so.0()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextlib-0.17.so()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgcj_bc.so.1()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libasprintf.so.0()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
---> Package libcurl-devel.x86_64 0:7.19.7-37.el6_4 will be installed
--> Processing Dependency: libidn-devel for package: libcurl-devel-7.19.7-37.el6_4.x86_64
--> Processing Dependency: automake for package: libcurl-devel-7.19.7-37.el6_4.x86_64
---> Package openssl-devel.x86_64 0:1.0.1e-30.el6 will be installed
--> Processing Dependency: openssl = 1.0.1e-30.el6 for package: openssl-devel-1.0.1e-30.el6.x86_64
--> Processing Dependency: krb5-devel for package: openssl-devel-1.0.1e-30.el6.x86_64
---> Package perl-ExtUtils-MakeMaker.x86_64 0:6.55-136.el6 will be installed
--> Processing Dependency: perl-devel for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
--> Processing Dependency: perl(Test::Harness) for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed
--> Running transaction check
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
--> Processing Dependency: autoconf >= 2.62 for package: automake-1.11.1-4.el6.noarch
---> Package gettext.x86_64 0:0.17-16.el6 will be installed
--> Processing Dependency: cvs for package: gettext-0.17-16.el6.x86_64
---> Package gettext-libs.x86_64 0:0.17-16.el6 will be installed
---> Package krb5-devel.x86_64 0:1.10.3-37.el6_6 will be installed
--> Processing Dependency: krb5-libs = 1.10.3-37.el6_6 for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
---> Package libgcj.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: zip >= 2.1 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libart_lgpl >= 2.1.0 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: gtk2 >= 2.4.0 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpangoft2-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpangocairo-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpango-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgtk-x11-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgdk_pixbuf-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgdk-x11-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libcairo.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libatk-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libasound.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXrender.so.1()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXrandr.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libSM.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
---> Package libidn-devel.x86_64 0:1.18-2.el6 will be installed
---> Package openssl.x86_64 0:1.0.1e-15.el6 will be updated
---> Package openssl.x86_64 0:1.0.1e-30.el6 will be an update
---> Package perl-Test-Harness.x86_64 0:3.17-136.el6 will be installed
---> Package perl-devel.x86_64 4:5.10.1-136.el6 will be installed
--> Processing Dependency: perl(ExtUtils::ParseXS) for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: gdbm-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: db4-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.22-3.el6 will be installed
---> Package atk.x86_64 0:1.30.0-1.el6 will be installed
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package cairo.x86_64 0:1.8.8-3.1.el6 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libpixman-1.so.0()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
---> Package cvs.x86_64 0:1.11.23-16.el6 will be installed
---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be installed
--> Processing Dependency: db4-cxx = 4.7.25-18.el6_4 for package: db4-devel-4.7.25-18.el6_4.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-18.el6_4.x86_64
---> Package fontconfig.x86_64 0:2.8.0-3.el6 will be installed
---> Package freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package gdbm-devel.x86_64 0:1.8.0-36.el6 will be installed
---> Package gtk2.x86_64 0:2.20.1-4.el6 will be installed
--> Processing Dependency: libtiff >= 3.6.1 for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: hicolor-icon-theme for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libtiff.so.3()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjasper.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libcups.so.2()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXinerama.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXi.so.6()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXfixes.so.3()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXdamage.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXcursor.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXcomposite.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
---> Package keyutils-libs-devel.x86_64 0:1.4-4.el6 will be installed
---> Package krb5-libs.x86_64 0:1.10.3-10.el6_4.6 will be updated
---> Package krb5-libs.x86_64 0:1.10.3-37.el6_6 will be an update
---> Package libICE.x86_64 0:1.0.6-1.el6 will be installed
---> Package libSM.x86_64 0:1.2.1-2.el6 will be installed
---> Package libXrandr.x86_64 0:1.4.0-1.el6 will be installed
---> Package libXrender.x86_64 0:0.9.7-2.el6 will be installed
---> Package libXtst.x86_64 0:1.2.1-2.el6 will be installed
---> Package libart_lgpl.x86_64 0:2.3.20-5.1.el6 will be installed
---> Package libcom_err-devel.x86_64 0:1.41.12-18.el6 will be installed
---> Package libselinux-devel.x86_64 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libselinux = 2.0.94-5.3.el6_4.1 for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
---> Package pango.x86_64 0:1.28.1-7.el6_3 will be installed
--> Processing Dependency: libthai >= 0.1.9 for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libthai.so.0(LIBTHAI_0.1)(64bit) for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libthai.so.0()(64bit) for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libXft.so.2()(64bit) for package: pango-1.28.1-7.el6_3.x86_64
---> Package perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-136.el6 will be installed
---> Package zip.x86_64 0:3.0-1.el6 will be installed
--> Running transaction check
---> Package cups-libs.x86_64 1:1.4.2-50.el6_4.5 will be installed
--> Processing Dependency: libgnutls.so.26(GNUTLS_1_4)(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libgnutls.so.26()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libavahi-common.so.3()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libavahi-client.so.3()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
---> Package db4-cxx.x86_64 0:4.7.25-18.el6_4 will be installed
---> Package hicolor-icon-theme.noarch 0:0.11-1.1.el6 will be installed
---> Package jasper-libs.x86_64 0:1.900.1-15.el6_1.1 will be installed
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXcomposite.x86_64 0:0.4.3-4.el6 will be installed
---> Package libXcursor.x86_64 0:1.1.13-6.20130524git8f677eaea.el6 will be installed
---> Package libXdamage.x86_64 0:1.1.3-4.el6 will be installed
---> Package libXext.x86_64 0:1.3.1-2.el6 will be installed
---> Package libXfixes.x86_64 0:5.0-3.el6 will be installed
---> Package libXft.x86_64 0:2.3.1-2.el6 will be installed
---> Package libXi.x86_64 0:1.6.1-3.el6 will be installed
---> Package libXinerama.x86_64 0:1.1.2-2.el6 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-1.el6 will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package libselinux.i686 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libdl.so.2(GLIBC_2.1) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libdl.so.2(GLIBC_2.0) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libdl.so.2 for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libc.so.6(GLIBC_2.8) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: ld-linux.so.2(GLIBC_2.3) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: ld-linux.so.2 for package: libselinux-2.0.94-5.3.el6_4.1.i686
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed
---> Package libthai.x86_64 0:0.1.12-3.el6 will be installed
---> Package libtiff.x86_64 0:3.9.4-9.el6_3 will be installed
---> Package pixman.x86_64 0:0.26.2-5.el6_4 will be installed
--> Running transaction check
---> Package avahi-libs.x86_64 0:0.6.25-12.el6 will be installed
---> Package glibc.x86_64 0:2.12-1.132.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-headers-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-common-2.12-1.132.el6.x86_64
---> Package glibc.i686 0:2.12-1.149.el6_6.5 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.149.el6_6.5.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.149.el6_6.5.i686
---> Package glibc.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package gnutls.x86_64 0:2.8.5-10.el6_4.2 will be installed
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-devel.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-headers.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
---> Package nss-softokn-freebl.i686 0:3.14.3-9.el6 will be installed
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libselinux.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of libselinux installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.
3. You have duplicate versions of libselinux installed already.
You can use "yum check" to get yum show these errors.
...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).
Protected multilib versions: libselinux-2.0.94-5.3.el6_4.1.i686 != libselinux-2.0.94-5.8.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@server01 ~]#
yum repolist 显示:
[root@server01 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
puppetlabs-deps Puppet Labs Dependencies El 6 - x86_64 77
puppetlabs-products Puppet Labs Products El 6 - x86_64 538
release.update 6.6.5 6,367
supplemental.release supplemental.6 84
supplemental.release.update supplemental.6.6.5 1
repolist: 7,067
[root@server01 ~]#
尝试了 运行 以下命令,但仍然出错(它执行了一些 downloading/resolving 依赖关系,但最终因以下新错误而失败)。
yum-complete-transaction;百胜发行版同步; yum clean all;百胜更新
Transaction Check Error:
file /usr/bin/extlookup2hiera from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera/backend/puppet_backend.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera/scope.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera_puppet.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_array.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_hash.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_include.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
Error Summary
-------------
我看到这个 post 为 CentOS 6 (x86_64) 安装额外的软件包 repo,但这没有帮助。使用这个,现在我遇到了第三个错误。
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@server01 yum.repos.d]#
现在 yum repolist 显示额外的一行(对于额外的软件包 - CentOS):
epel Extra Packages for Enterprise Linux 6 - x86_64 11,838
仍然,运行:
sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 仍然给我同样的错误(我首先提到在顶部)。
/etc/yum.repos.d 包含 --
#密码; ls -l
/etc/yum.repos.d
total 32
-rw-r--r-- 1 root root 14540 Nov 5 2012 epel-release-6-8.noarch.rpm
-rw-r--r-- 1 root root 957 Nov 4 2012 epel.repo
-rw-r--r-- 1 root root 1056 Nov 4 2012 epel-testing.repo
-rw-r--r--. 1 root root 1250 Jan 22 2014 puppetlabs.repo
-rw-r--r--. 1 root root 406 Dec 8 10:48 mycompany.redhat.repo
Puppetlabs.repo 对于这个 post 似乎是多余的,前 2 个 .repo 文件在我下载 + 安装额外的包 repo rpm 后安装在这里(如上面 post/link 中所列) ) 和 mycompany.redhat.repo 中的内容是:
[release.update]
name=$releasever.$YUM0
baseurl=http://manager/yum/$basearch/$releasever/$YUM0/Server
enabled=1
gpgcheck=0
[supplemental.release]
name=supplemental.$releasever
baseurl=http://manager/yum/$basearch/supplemental/$releasever
enabled=1
gpgcheck=0
[supplemental.release.update]
name=supplemental.$releasever.$YUM0
baseurl=http://manager/yum/$basearch/supplemental/$YUM0
enabled=1
gpgcheck=0
我在 /etc/yum.repos.d/CentOS-Base.repo 或某个名称创建了一个文件(我让它有点通用所以它适用于任何 6.x 或 7 版本)。它适用于 6.5。如果您在 CentOS 7.x 上使用此文件时发现任何问题,那么您所需要的只是正确的 CentOS-Base.repo(CentOS 7.x 或任何 X.Y 版本的官方 .repo 文件) 并且 post 中出现的问题将得到解决。
例如:
/etc/yum.repos.d/CentOS-Base-Custom.repo 的内容
(PS:我将其命名为自定义,因为我没有使用硬编码版本 6,而是在 中使用了 $releasever 变量.repo 文件中的名称、镜像列表、baseurl、gpgkey 字段。
# 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
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
运行: sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 并且没有任何错误。
Re-ran 相同,输出符合预期。
[root@server01 yum.repos.d]# sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.symnds.com
* epel: mirror.cogentco.com
* extras: centos.mirror.nac.net
* updates: mirror.ash.fastserv.com
Setting up Install Process
Package libcurl-devel-7.19.7-46.el6.x86_64 already installed and latest version
Package expat-devel-2.0.1-11.el6_2.x86_64 already installed and latest version
Package gettext-devel-0.17-18.el6.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-42.el6_7.1.x86_64 already installed and latest version
Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package perl-ExtUtils-MakeMaker-6.55-141.el6_7.1.x86_64 already installed and latest version
Nothing to do
[root@server01 yum.repos.d]#
我现在需要的是在 Ansible 中使用模板模块(并将此文件设置在目标机器上的 /etc/yum.repos.d 文件夹中),一旦完成,上面的 pre-requisites将安装而不会出现任何错误,ansible 将安装我需要的所需(用户定义的 GIT 版本)。
这可能是因为架构之间的版本不匹配。查看它尝试更新的 32 位版本与 64 位版本有何不同。
先尝试更新安装的 64 位版本?
$sudo yum update libselinux.x86_64
$sudo yum update libselinux.i686
如果仍然失败,请确保您只安装了一个版本的软件并删除任何旧版本。
$sudo yum erase libselinux-2.0.94-5.8.el6.x86_64
对我有用的方法:
sudo package-cleanup --dupes
sudo package-cleanup --cleandupes
sudo package-cleanup --cleandupes --removenewestdupes
sudo yum update
如果 yum 更新仍然失败 - 继续如下操作:
使用 yum search 检查有问题的库的安装版本
例如:如果问题出在 libselinux
sudo yum list --showduplicates libselinux
在结果中,您可能会看到以 x86_64 或 i686 结尾的库版本
例如 :
libselinux.i686
libselinux.x86_64
现在-我们需要找出要删除其中的哪一个,所以
我们 运行:
uname -a
如果我们在结果中看到(在左边的第 3 个参数上):类似于:4.18.16-x86_64-myserver 那么我们是 保留 后缀为 x86_64 的库并用
后缀 i686
如果我们在第 3 个参数上看到 i686,那么我们 摆脱 x86_64 并保留 i686
所以,例如,如果我有 4.18.16-x86_64-myserver,我将去 运行:
sudo yum erase libselinux.i686
完成后 - 我们可以 运行 yum update 或 yum reinstall 我们要升级的库 ( libselinux)
我在 RHEL 7.7 上也遇到了同样的问题,我已经修复如下:
在 运行 #yum update 命令之后我遇到了以下错误:
采取的步骤:
#yum install yum-utils
#yum update kernel*
#package-cleanup --dupes
#package-cleanup --problems
然后我已经一个一个更新了这个包
#yum update audit
#yum update Network*
#yum update initscripts
#yum remove grub2-tools-minimal
#yum update grub2*
最后 运行
#yum 更新
效果很好。
如果其他方法对你的情况不起作用,你也可以尝试降级软件包,例如:
yum downgrade libxml2.x86_64
就我而言,我在使用 libxml2 的 Centos 7 上遇到了问题:
Protected multilib versions: libxml2-2.9.1-6.el7.4.i686 != libxml2-2.9.1-6.el7.5.x86_64
但实际上我只安装了1个libxml2包,也就是x86_64。在尝试使用 --setopt=protected_multilib=false
选项安装其他软件包时,我收到此消息
package libxml2-2.9.1-6.el7.5.x86_64 (which is newer than libxml2-2.9.1-6.el7.4.i686) is already installed
在那之后,我尝试降级软件包并且成功了。
我有 CentOS 6.5
我正在尝试通过 yum 安装 git,但在安装先决条件包时出现错误。 我不需要,但它不会伤害 运行 使用 root 执行 sudo。
错误信息:
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libselinux.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of libselinux installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.
3. You have duplicate versions of libselinux installed already.
You can use "yum check" to get yum show these errors.
...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).
Protected multilib versions: libselinux-2.0.94-5.3.el6_4.1.i686 != libselinux-2.0.94-5.8.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
完整日志:
[root@server01 ~]# sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package gcc-4.4.7-4.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package expat-devel.x86_64 0:2.0.1-11.el6_2 will be installed
---> Package gettext-devel.x86_64 0:0.17-16.el6 will be installed
--> Processing Dependency: gettext-libs = 0.17-16.el6 for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: gettext = 0.17-16.el6 for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextsrc-0.17.so()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextpo.so.0()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgettextlib-0.17.so()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libgcj_bc.so.1()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: libasprintf.so.0()(64bit) for package: gettext-devel-0.17-16.el6.x86_64
---> Package libcurl-devel.x86_64 0:7.19.7-37.el6_4 will be installed
--> Processing Dependency: libidn-devel for package: libcurl-devel-7.19.7-37.el6_4.x86_64
--> Processing Dependency: automake for package: libcurl-devel-7.19.7-37.el6_4.x86_64
---> Package openssl-devel.x86_64 0:1.0.1e-30.el6 will be installed
--> Processing Dependency: openssl = 1.0.1e-30.el6 for package: openssl-devel-1.0.1e-30.el6.x86_64
--> Processing Dependency: krb5-devel for package: openssl-devel-1.0.1e-30.el6.x86_64
---> Package perl-ExtUtils-MakeMaker.x86_64 0:6.55-136.el6 will be installed
--> Processing Dependency: perl-devel for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
--> Processing Dependency: perl(Test::Harness) for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed
--> Running transaction check
---> Package automake.noarch 0:1.11.1-4.el6 will be installed
--> Processing Dependency: autoconf >= 2.62 for package: automake-1.11.1-4.el6.noarch
---> Package gettext.x86_64 0:0.17-16.el6 will be installed
--> Processing Dependency: cvs for package: gettext-0.17-16.el6.x86_64
---> Package gettext-libs.x86_64 0:0.17-16.el6 will be installed
---> Package krb5-devel.x86_64 0:1.10.3-37.el6_6 will be installed
--> Processing Dependency: krb5-libs = 1.10.3-37.el6_6 for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.10.3-37.el6_6.x86_64
---> Package libgcj.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: zip >= 2.1 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libart_lgpl >= 2.1.0 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: gtk2 >= 2.4.0 for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpangoft2-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpangocairo-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libpango-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgtk-x11-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgdk_pixbuf-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libgdk-x11-2.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libcairo.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libatk-1.0.so.0()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libasound.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXrender.so.1()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libXrandr.so.2()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libSM.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: libgcj-4.4.7-4.el6.x86_64
---> Package libidn-devel.x86_64 0:1.18-2.el6 will be installed
---> Package openssl.x86_64 0:1.0.1e-15.el6 will be updated
---> Package openssl.x86_64 0:1.0.1e-30.el6 will be an update
---> Package perl-Test-Harness.x86_64 0:3.17-136.el6 will be installed
---> Package perl-devel.x86_64 4:5.10.1-136.el6 will be installed
--> Processing Dependency: perl(ExtUtils::ParseXS) for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: gdbm-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: db4-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.22-3.el6 will be installed
---> Package atk.x86_64 0:1.30.0-1.el6 will be installed
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package cairo.x86_64 0:1.8.8-3.1.el6 will be installed
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libpixman-1.so.0()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
---> Package cvs.x86_64 0:1.11.23-16.el6 will be installed
---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be installed
--> Processing Dependency: db4-cxx = 4.7.25-18.el6_4 for package: db4-devel-4.7.25-18.el6_4.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-18.el6_4.x86_64
---> Package fontconfig.x86_64 0:2.8.0-3.el6 will be installed
---> Package freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package gdbm-devel.x86_64 0:1.8.0-36.el6 will be installed
---> Package gtk2.x86_64 0:2.20.1-4.el6 will be installed
--> Processing Dependency: libtiff >= 3.6.1 for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: hicolor-icon-theme for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libtiff.so.3()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libjasper.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libcups.so.2()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXinerama.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXi.so.6()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXfixes.so.3()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXdamage.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXcursor.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
--> Processing Dependency: libXcomposite.so.1()(64bit) for package: gtk2-2.20.1-4.el6.x86_64
---> Package keyutils-libs-devel.x86_64 0:1.4-4.el6 will be installed
---> Package krb5-libs.x86_64 0:1.10.3-10.el6_4.6 will be updated
---> Package krb5-libs.x86_64 0:1.10.3-37.el6_6 will be an update
---> Package libICE.x86_64 0:1.0.6-1.el6 will be installed
---> Package libSM.x86_64 0:1.2.1-2.el6 will be installed
---> Package libXrandr.x86_64 0:1.4.0-1.el6 will be installed
---> Package libXrender.x86_64 0:0.9.7-2.el6 will be installed
---> Package libXtst.x86_64 0:1.2.1-2.el6 will be installed
---> Package libart_lgpl.x86_64 0:2.3.20-5.1.el6 will be installed
---> Package libcom_err-devel.x86_64 0:1.41.12-18.el6 will be installed
---> Package libselinux-devel.x86_64 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libselinux = 2.0.94-5.3.el6_4.1 for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.3.el6_4.1.x86_64
---> Package pango.x86_64 0:1.28.1-7.el6_3 will be installed
--> Processing Dependency: libthai >= 0.1.9 for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libthai.so.0(LIBTHAI_0.1)(64bit) for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libthai.so.0()(64bit) for package: pango-1.28.1-7.el6_3.x86_64
--> Processing Dependency: libXft.so.2()(64bit) for package: pango-1.28.1-7.el6_3.x86_64
---> Package perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-136.el6 will be installed
---> Package zip.x86_64 0:3.0-1.el6 will be installed
--> Running transaction check
---> Package cups-libs.x86_64 1:1.4.2-50.el6_4.5 will be installed
--> Processing Dependency: libgnutls.so.26(GNUTLS_1_4)(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libgnutls.so.26()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libavahi-common.so.3()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
--> Processing Dependency: libavahi-client.so.3()(64bit) for package: 1:cups-libs-1.4.2-50.el6_4.5.x86_64
---> Package db4-cxx.x86_64 0:4.7.25-18.el6_4 will be installed
---> Package hicolor-icon-theme.noarch 0:0.11-1.1.el6 will be installed
---> Package jasper-libs.x86_64 0:1.900.1-15.el6_1.1 will be installed
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXcomposite.x86_64 0:0.4.3-4.el6 will be installed
---> Package libXcursor.x86_64 0:1.1.13-6.20130524git8f677eaea.el6 will be installed
---> Package libXdamage.x86_64 0:1.1.3-4.el6 will be installed
---> Package libXext.x86_64 0:1.3.1-2.el6 will be installed
---> Package libXfixes.x86_64 0:5.0-3.el6 will be installed
---> Package libXft.x86_64 0:2.3.1-2.el6 will be installed
---> Package libXi.x86_64 0:1.6.1-3.el6 will be installed
---> Package libXinerama.x86_64 0:1.1.2-2.el6 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-1.el6 will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package libselinux.i686 0:2.0.94-5.3.el6_4.1 will be installed
--> Processing Dependency: libdl.so.2(GLIBC_2.1) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libdl.so.2(GLIBC_2.0) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libdl.so.2 for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: libc.so.6(GLIBC_2.8) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: ld-linux.so.2(GLIBC_2.3) for package: libselinux-2.0.94-5.3.el6_4.1.i686
--> Processing Dependency: ld-linux.so.2 for package: libselinux-2.0.94-5.3.el6_4.1.i686
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed
---> Package libthai.x86_64 0:0.1.12-3.el6 will be installed
---> Package libtiff.x86_64 0:3.9.4-9.el6_3 will be installed
---> Package pixman.x86_64 0:0.26.2-5.el6_4 will be installed
--> Running transaction check
---> Package avahi-libs.x86_64 0:0.6.25-12.el6 will be installed
---> Package glibc.x86_64 0:2.12-1.132.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-headers-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-common-2.12-1.132.el6.x86_64
---> Package glibc.i686 0:2.12-1.149.el6_6.5 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.149.el6_6.5.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.149.el6_6.5.i686
---> Package glibc.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package gnutls.x86_64 0:2.8.5-10.el6_4.2 will be installed
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-devel.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-headers.x86_64 0:2.12-1.149.el6_6.5 will be an update
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
---> Package nss-softokn-freebl.i686 0:3.14.3-9.el6 will be installed
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libselinux.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of libselinux installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.
3. You have duplicate versions of libselinux installed already.
You can use "yum check" to get yum show these errors.
...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).
Protected multilib versions: libselinux-2.0.94-5.3.el6_4.1.i686 != libselinux-2.0.94-5.8.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@server01 ~]#
yum repolist 显示:
[root@server01 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
puppetlabs-deps Puppet Labs Dependencies El 6 - x86_64 77
puppetlabs-products Puppet Labs Products El 6 - x86_64 538
release.update 6.6.5 6,367
supplemental.release supplemental.6 84
supplemental.release.update supplemental.6.6.5 1
repolist: 7,067
[root@server01 ~]#
尝试了 运行 以下命令,但仍然出错(它执行了一些 downloading/resolving 依赖关系,但最终因以下新错误而失败)。 yum-complete-transaction;百胜发行版同步; yum clean all;百胜更新
Transaction Check Error:
file /usr/bin/extlookup2hiera from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera/backend/puppet_backend.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera/scope.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/hiera_puppet.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_array.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_hash.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
file /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/hiera_include.rb from install of puppet-3.8.4-1.el6.noarch conflicts with file from package hiera-puppet-1.0.0-1.el6.noarch
Error Summary
-------------
我看到这个 post 为 CentOS 6 (x86_64) 安装额外的软件包 repo,但这没有帮助。使用这个,现在我遇到了第三个错误。
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@server01 yum.repos.d]#
现在 yum repolist 显示额外的一行(对于额外的软件包 - CentOS):
epel Extra Packages for Enterprise Linux 6 - x86_64 11,838
仍然,运行: sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 仍然给我同样的错误(我首先提到在顶部)。
/etc/yum.repos.d 包含 -- #密码; ls -l
/etc/yum.repos.d
total 32
-rw-r--r-- 1 root root 14540 Nov 5 2012 epel-release-6-8.noarch.rpm
-rw-r--r-- 1 root root 957 Nov 4 2012 epel.repo
-rw-r--r-- 1 root root 1056 Nov 4 2012 epel-testing.repo
-rw-r--r--. 1 root root 1250 Jan 22 2014 puppetlabs.repo
-rw-r--r--. 1 root root 406 Dec 8 10:48 mycompany.redhat.repo
Puppetlabs.repo 对于这个 post 似乎是多余的,前 2 个 .repo 文件在我下载 + 安装额外的包 repo rpm 后安装在这里(如上面 post/link 中所列) ) 和 mycompany.redhat.repo 中的内容是:
[release.update]
name=$releasever.$YUM0
baseurl=http://manager/yum/$basearch/$releasever/$YUM0/Server
enabled=1
gpgcheck=0
[supplemental.release]
name=supplemental.$releasever
baseurl=http://manager/yum/$basearch/supplemental/$releasever
enabled=1
gpgcheck=0
[supplemental.release.update]
name=supplemental.$releasever.$YUM0
baseurl=http://manager/yum/$basearch/supplemental/$YUM0
enabled=1
gpgcheck=0
我在 /etc/yum.repos.d/CentOS-Base.repo 或某个名称创建了一个文件(我让它有点通用所以它适用于任何 6.x 或 7 版本)。它适用于 6.5。如果您在 CentOS 7.x 上使用此文件时发现任何问题,那么您所需要的只是正确的 CentOS-Base.repo(CentOS 7.x 或任何 X.Y 版本的官方 .repo 文件) 并且 post 中出现的问题将得到解决。
例如: /etc/yum.repos.d/CentOS-Base-Custom.repo 的内容 (PS:我将其命名为自定义,因为我没有使用硬编码版本 6,而是在 中使用了 $releasever 变量.repo 文件中的名称、镜像列表、baseurl、gpgkey 字段。
# 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
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever
运行: sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 并且没有任何错误。
Re-ran 相同,输出符合预期。
[root@server01 yum.repos.d]# sudo yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.symnds.com
* epel: mirror.cogentco.com
* extras: centos.mirror.nac.net
* updates: mirror.ash.fastserv.com
Setting up Install Process
Package libcurl-devel-7.19.7-46.el6.x86_64 already installed and latest version
Package expat-devel-2.0.1-11.el6_2.x86_64 already installed and latest version
Package gettext-devel-0.17-18.el6.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-42.el6_7.1.x86_64 already installed and latest version
Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package perl-ExtUtils-MakeMaker-6.55-141.el6_7.1.x86_64 already installed and latest version
Nothing to do
[root@server01 yum.repos.d]#
我现在需要的是在 Ansible 中使用模板模块(并将此文件设置在目标机器上的 /etc/yum.repos.d 文件夹中),一旦完成,上面的 pre-requisites将安装而不会出现任何错误,ansible 将安装我需要的所需(用户定义的 GIT 版本)。
这可能是因为架构之间的版本不匹配。查看它尝试更新的 32 位版本与 64 位版本有何不同。
先尝试更新安装的 64 位版本?
$sudo yum update libselinux.x86_64
$sudo yum update libselinux.i686
如果仍然失败,请确保您只安装了一个版本的软件并删除任何旧版本。
$sudo yum erase libselinux-2.0.94-5.8.el6.x86_64
对我有用的方法:
sudo package-cleanup --dupes
sudo package-cleanup --cleandupes
sudo package-cleanup --cleandupes --removenewestdupes
sudo yum update
如果 yum 更新仍然失败 - 继续如下操作:
使用 yum search 检查有问题的库的安装版本 例如:如果问题出在 libselinux
sudo yum list --showduplicates libselinux
在结果中,您可能会看到以 x86_64 或 i686 结尾的库版本 例如 : libselinux.i686 libselinux.x86_64
现在-我们需要找出要删除其中的哪一个,所以 我们 运行:
uname -a
如果我们在结果中看到(在左边的第 3 个参数上):类似于:4.18.16-x86_64-myserver 那么我们是 保留 后缀为 x86_64 的库并用 后缀 i686
如果我们在第 3 个参数上看到 i686,那么我们 摆脱 x86_64 并保留 i686
所以,例如,如果我有 4.18.16-x86_64-myserver,我将去 运行:
sudo yum erase libselinux.i686
完成后 - 我们可以 运行 yum update 或 yum reinstall 我们要升级的库 ( libselinux)
我在 RHEL 7.7 上也遇到了同样的问题,我已经修复如下:
在 运行 #yum update 命令之后我遇到了以下错误:
采取的步骤:
#yum install yum-utils
#yum update kernel*
#package-cleanup --dupes
#package-cleanup --problems
然后我已经一个一个更新了这个包
#yum update audit
#yum update Network*
#yum update initscripts
#yum remove grub2-tools-minimal
#yum update grub2*
最后 运行 #yum 更新
效果很好。
如果其他方法对你的情况不起作用,你也可以尝试降级软件包,例如:
yum downgrade libxml2.x86_64
就我而言,我在使用 libxml2 的 Centos 7 上遇到了问题:
Protected multilib versions: libxml2-2.9.1-6.el7.4.i686 != libxml2-2.9.1-6.el7.5.x86_64
但实际上我只安装了1个libxml2包,也就是x86_64。在尝试使用 --setopt=protected_multilib=false
选项安装其他软件包时,我收到此消息
package libxml2-2.9.1-6.el7.5.x86_64 (which is newer than libxml2-2.9.1-6.el7.4.i686) is already installed
在那之后,我尝试降级软件包并且成功了。