yum command wont uninstall and or reinstall an app on centos

Posted by Dark Training on June 24, 2011 tags: | linux | centos

Recently I came across a heart stopper when upgrading an CentOS 5.6 server.

The server had not been updated in a while and when I went to get updates with yum update I got the following error:

Package samba3x requires samba3x-common = 0:3.3.8-0.52.el5_5.2

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

In this case the error was from samba3x-scannedonly-0.21-2.el5.rf.x86_64. So naturally I just tried to remove it.

yum remove samba3x-scannedonly-0.21-2.el5.rf.x86_64

However this would "LOOK" like it worked but there was an error on screen right above where it said complete that said it could not delete because the service was not running. WTF?

I could not remove it with rpm -e because it would not find the dependency. In this case I knew that the package HAD been deleted but yum still thought it was installed. It was a paradox though because if I tried to install samba3x it would fail because the scannedonly dep was broke and scannedonly would not reinstall because it depended on samba3x.

I was able to clear the item by using the following RPM command:

rpm -e --noscripts samba3x-scannedonly

That allowed yum to think it was no longer installed and allowed me to install the samba3x packages.

I was pulling my hair out, but I knew I would find a way to fix this. Hopefully if you are ready this it will help you too. Feel free to leave a note below if it did.