[Linux] centos7.4--yum install gcc报错


本文总阅读量

[yum install gcc执行报错如下:]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-28.el7_5.1 will be installed
--> Processing Dependency: libgomp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: cpp = 4.8.5-28.el7_5.1 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-28.el7_5.1.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-28.el7_5.1 will be installed
---> Package glibc-devel.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
--> Processing Dependency: glibc = 2.17-222.el7 for package: glibc-devel-2.17-222.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-222.el7.x86_64
---> Package libgomp.x86_64 0:4.8.5-11.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-28.el7_5.1 will be an update
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-157.el7_3.5 will be updated
--> Processing Dependency: glibc = 2.17-157.el7_3.5 for package: glibc-common-2.17-157.el7_3.5.x86_64
---> Package glibc.x86_64 0:2.17-222.el7 will be an update
---> Package glibc-headers.x86_64 0:2.17-222.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-222.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-222.el7.x86_64
--> Running transaction check
---> Package glibc.x86_64 0:2.17-157.el7_3.5 will be updated
--> Processing Dependency: glibc = 2.17-157.el7_3.5 for package: glibc-common-2.17-157.el7_3.5.x86_64
---> Package kernel-headers.x86_64 0:3.10.0-862.9.1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: glibc-common-2.17-157.el7_3.5.x86_64 (@CentOS-Updates)
Requires: glibc = 2.17-157.el7_3.5
Removing: glibc-2.17-157.el7_3.5.x86_64 (@CentOS-Updates)
glibc = 2.17-157.el7_3.5
Updated By: glibc-2.17-222.el7.x86_64 (base)
glibc = 2.17-222.el7
You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
glibc-common-2.17-222.el7.x86_64 is a duplicate with glibc-common-2.17-157.el7_3.5.x86_64
glibc-common-2.17-222.el7.x86_64 has missing requires of glibc = ('0', '2.17', '222.el7')
libgcc-4.8.5-28.el7_5.1.x86_64 is a duplicate with libgcc-4.8.5-11.el7.x86_64

产生该问题的主要原因是:在系统upgrade的时候,残存了上一个版本的软件包

[解决办法:]

首先安装 yum-utils 套件

1
yum install yum-utils

执行clean duplicate package  

1
package-cleanup --cleandupes

重新安装glibc

1
yum reinstall glibc glibc-common libgcc

安装完成之后再安装gcc

1
yum install gcc
目录
  1. 1. [yum install gcc执行报错如下:]
  2. 2. [解决办法:]

Proudly powered by Hexo and Theme by Lap
本站访客数人次
© 2020 zeven0707's blog