CentOS 7.x troubleshooting package management issues

From Notes_Wiki

Home > CentOS > CentOS 7.x > System Administration > Package management > CentOS 7.x troubleshooting package management issues

If a system update fails mid-way without completing yum transaction then it is possible to have two copies of the same package referring to same file such as:

[saurabh@rekallcm1 ~]$ rpm -qf /usr/bin/make
make-3.82-23.el7.x86_64
make-3.82-24.el7.x86_64

This typically does not gets solved by 'yum update' as package already exists error is shown such as:

[saurabh@rekallcm1 ~]$ sudo yum update make
....
Resolving Dependencies
--> Running transaction check
---> Package make.x86_64 1:3.82-23.el7 will be updated
---> Package make.x86_64 1:3.82-24.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                         Arch                                              Version                                                   Repository                                       Size
===================================================================================================================================================================================================================
Updating:
 make                                            x86_64                                            1:3.82-24.el7                                             base                                            421 k

Transaction Summary
===================================================================================================================================================================================================================
Upgrade  1 Package

Total size: 421 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test


Transaction check error:
  package make-1:3.82-24.el7.x86_64 is already installed

Error Summary
-------------

The issue is however solved by removing older package. This fortunately does not affects files shared between two packages:

[saurabh@rekallcm1 ~]$ sudo yum remove make-3.82-23.el7.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package make.x86_64 1:3.82-23.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                        Arch                                             Version                                                 Repository                                           Size
===================================================================================================================================================================================================================
Removing:
 make                                           x86_64                                           1:3.82-23.el7                                           @anaconda                                           1.1 M

Transaction Summary
===================================================================================================================================================================================================================
Remove  1 Package

Installed size: 1.1 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 1:make-3.82-23.el7.x86_64                                                                                                                                                                       1/1 
  Verifying  : 1:make-3.82-23.el7.x86_64                                                                                                                                                                       1/1 

Removed:
  make.x86_64 1:3.82-23.el7                                                                                                                                                                                        

Complete!
[saurabh@rekallcm1 ~]$ rpm -qa make
make-3.82-24.el7.x86_64
[saurabh@rekallcm1 ~]$ rpm -qV make
[saurabh@rekallcm1 ~]$ rpm -qf /usr/bin/make
make-3.82-24.el7.x86_64


Home > CentOS > CentOS 7.x > System Administration > Package management > CentOS 7.x troubleshooting package management issues