4

Sometime ago I tried to install Steam on my CentOS 5 server and tried almost everything I found on Internet and it seems that I have been able to leave libstdc++ installed and not installed at the same time.

CPanel is failing to update because it doesn't find the correct version installed but yum is unable to install it because it's already installed.

¿How can I fix this situation and reach a consistent state?

# yum install libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * contrib: mirror.wiredtree.com
addons                                                   | 1.9 kB     00:00
base                                                     | 1.1 kB     00:00
centosplus                                               | 1.9 kB     00:00
contrib                                                  | 1.9 kB     00:00
extras                                                   | 2.1 kB     00:00
updates                                                  | 1.9 kB     00:00
wiredtree                                                |  951 B     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Package matching libstdc++-4.1.2-55.el5.i386 already installed. Checking for update.
Nothing to do

# yum remove libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: libstdc++-4.1.2-55.el5
Loading mirror speeds from cached hostfile
 * contrib: mirror.wiredtree.com
addons                                                   | 1.9 kB     00:00
base                                                     | 1.1 kB     00:00
centosplus                                               | 1.9 kB     00:00
contrib                                                  | 1.9 kB     00:00
extras                                                   | 2.1 kB     00:00
updates                                                  | 1.9 kB     00:00
wiredtree                                                |  951 B     00:00
Excluding Packages in global exclude list
Finished
Package(s) libstdc++-4.1.2-55.el5 available, but not installed.
No Packages marked for removal


# yum reinstall libstdc++-4.1.2-55.el5
Loaded plugins: fastestmirror
Setting up Reinstall Process
Loading mirror speeds from cached hostfile
 * contrib: mirror.wiredtree.com
addons                                                   | 1.9 kB     00:00
base                                                     | 1.1 kB     00:00
centosplus                                               | 1.9 kB     00:00
contrib                                                  | 1.9 kB     00:00
extras                                                   | 2.1 kB     00:00
updates                                                  | 1.9 kB     00:00
wiredtree                                                |  951 B     00:00
Excluding Packages in global exclude list
Finished
No Match for argument: libstdc++-4.1.2-55.el5
Package(s) libstdc++-4.1.2-55.el5 available, but not installed.
Nothing to do

# yum --showduplicates list libstdc++ | expand
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * contrib: mirror.wiredtree.com
Excluding Packages in global exclude list
Finished
Installed Packages
libstdc++.i386                      4.3.2-7                            installed
Available Packages
libstdc++.i386                      4.1.2-55.el5                       base
2
  • 2
    I would flush and re-install. Don't waste your time trying to salvage it. Take you 20 minutes to re-install the base OS.
    – slm
    Nov 16, 2014 at 15:14
  • 1
    No that easy when it is a web server online.
    – frisco
    Nov 17, 2014 at 16:30

4 Answers 4

5

Thanks to Anthony Geoghegan pointing me in the right direction, I was able to find a working solution

rpm -e --justdb --nodeps libstdc++

That will remove the pacakge from the db without touching the files, then simple yum install will work.

2
  • 1
    Glad to have helped. I've had to use --nodeps a couple of times when rpm was confused but I wasn't aware of the --justdb option. Nov 18, 2014 at 9:31
  • I had to do the same for libstdc++-devel as well. Thanks for bringing your solution back here.
    – flickerfly
    Oct 10, 2017 at 22:22
2

Out of interest, I’d first try removing the package using the rpm command:

rpm -e libstdc++

However, I suspect that rpm’s internal database is corrupted and the above command won’t work so I’d then try rebuilding its database using:

rpm --rebuilddb
1
  • --rebuild did nothing and removing the package was not an option due to all of the dependencies but searching around the rpm command I was able to solve it so thanks.
    – frisco
    Nov 17, 2014 at 18:09
0

This can happen on x86_64 and multilib package. yum remove libstdc++ tries to remove 64bits version, but that is not installed. So in such situation you should address the package with arch. I.e:

yum remove libstdc++-4.1.2-55.el5.i386
-1

I had a similar situation on my host.

# yum --showduplicates list coreutils-libs

returned two versions of the same package apparently installed at the same time.

Installed Packages
coreutils-libs.x86_64                  8.4-37.el6_7.3                 @updates
coreutils-libs.x86_64                  8.4-43.el6                     installed
Available Packages
coreutils-libs.x86_64                  8.4-43.el6                     base

When I tried

# yum remove coreutils-libs

it failed, because it would have to remove other dependencies, including yum itself.

However, after several trials and errors I was able to fix that. The key is to use full name of the package, i.e. including the version and release suffix.

The main point is, that removing one of the packages would require physical removal but removing the other of the two will just remove the rpm DB record and thus bring the database into a consistent state.

In my case I could see I also had coreutils-8.4-37.el6_7.3 package installed, so the release -37.el6_7.3 was probably the right one (i.e. to be preserved).

When I told yum to remove the other one

# yum remove coreutils-libs-8.4-43.el6

everything ran without any error and RPM DB became consistent again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .