CentOS yum install gcc error: glibc-common conflicts with glibc

19,383

Solution 1

The conflict is arising as your CentOS is already having a glibc version which is not allowing glibc-common to install itself and related dependencies.

run rpm -qa | grep glibc and check for the output.

You may get 2 different versions as suppose :

glibc-common-2.12-1.80.el6_3.5.x86_64
glibc-common-2.12-1.80.el6_3.4.x86_64

If so then remove the 3.5 version:

rpm -e glibc-common-2.12-1.80.el6_3.5.x86_64

After that, run yum update and yum install gcc

Solution 2

As the answer by Shashank Bajpai says, you have a version of a package that needs to be updated, but can't be.

You could try yum install --skip-broken gcc to install what can be installed without conflicts, but that might turn out to be nothing. In any case, this sounds like a broken repository, or perhaps you've got an index for an incomplete repository (during updating it?) or something weird like that. Try yum clean metadata and run your command again, chances are it will now work.

Share:
19,383

Related videos on Youtube

Jason Cao
Author by

Jason Cao

Updated on September 18, 2022

Comments

  • Jason Cao
    Jason Cao almost 2 years

    I met a problem with installing gcc on my CentOS.

    Outputs of my command sudo yum install gcc:

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: centos.ustc.edu.cn
     * base: centos.ustc.edu.cn
     * extras: mirror.bit.edu.cn
     * updates: centos.ustc.edu.cn
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package gcc.x86_64 0:4.1.2-54.el5 set to be updated
    --> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc
    --> Processing Dependency: libgomp >= 4.1.2-54.el5 for package: gcc
    --> Processing Dependency: libgcc >= 4.1.2-54.el5 for package: gcc
    --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
    --> Running transaction check
    ---> Package cpp.x86_64 0:4.1.2-54.el5 set to be updated
    ---> Package glibc-devel.x86_64 0:2.5-118.el5_10.2 set to be updated
    --> Processing Dependency: glibc-headers = 2.5-118.el5_10.2 for package: glibc-devel
    --> Processing Dependency: glibc = 2.5-118.el5_10.2 for package: glibc-devel
    --> Processing Dependency: glibc-headers for package: glibc-devel
    ---> Package libgcc.i386 0:4.1.2-54.el5 set to be updated
    ---> Package libgcc.x86_64 0:4.1.2-54.el5 set to be updated
    ---> Package libgomp.x86_64 0:4.4.7-1.el5 set to be updated
    --> Running transaction check
    --> Processing Dependency: glibc = 2.5-49 for package: nscd
    ---> Package glibc.x86_64 0:2.5-118.el5_10.2 set to be updated
    --> Processing Dependency: glibc-common = 2.5-118.el5_10.2 for package: glibc
    ---> Package glibc-headers.x86_64 0:2.5-118.el5_10.2 set to be updated
    --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
    --> Processing Dependency: kernel-headers for package: glibc-headers
    --> Running transaction check
    ---> Package glibc-common.x86_64 0:2.5-118.el5_10.2 set to be updated
    ---> Package kernel-headers.x86_64 0:2.6.18-371.4.1.el5 set to be updated
    ---> Package nscd.x86_64 0:2.5-118.el5_10.2 set to be updated
    --> Processing Conflict: glibc-common conflicts glibc > 2.5
    --> Finished Dependency Resolution
    glibc-common-2.5-118.el5_10.2.x86_64 from updates has depsolving problems
      --> glibc-common conflicts with glibc
    Error: glibc-common conflicts with glibc
     You could try using --skip-broken to work around the problem
     You could try running: package-cleanup --problems
                            package-cleanup --dupes
                            rpm -Va --nofiles --nodigest
    

    I can not figure out what the "conflict" means, and I found nothing after a Google search. How can I get gcc working?