Friday, March 11, 2011

Cannot remove package with yum due to corruption

During an attempt to reinstall some packages with yum today, I ran into an unexpected issue.  Yum responded with the following error, when I was trying to reinstall NetworkManager:

Error in PREUN scriptlet in rpm package NetworkManager
1:NetworkManager-0.8.3.997-1.fc14.x86_64 was supposed to be removed but is not!

When this happens you will need to remove the RPM package manually.  However, since an error occurred in the rpm's pre and post install scripts, you will need to disable it by specifying the --noscript option.

Note that this should be a last resort and can be dangerous.  Rpm.org explains this in more details:
http://www.rpm.org/max-rpm/s1-rpm-install-additional-options.html#S2-RPM-INSTALL-NOSCRIPTS

In my particular case I successfully reinstalled NetworkManager after removing it with the following command:

$ sudo rpm -e --noscripts

No comments:

Post a Comment