Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I planned to erase all wine related package, first I queried with:

rpm -qa | grep wine

and it showed 6 or 7 packages, then I typed:

rpm -qa | rpm -e

After one or two minutes waiting, I realized that I typed wrong:(

So is there any way to recover this? Does rpm log the erasing action?

Below are some methods I have tried:

  1. man

I found there are some database files showed in 'man rpm' , and a db file about erasing named /var/lib/rpm/Removed which can't be found in my box.

and I tried to find clue with:

grep -nr rpm /var

but nothing valuable.

  1. google

I google with "rpm erase log", and it seems that there is no logging mechanism.

After rebooting, I can't log into X anymore cause X server is removed, then I 'rpm -i' it from ISO manually, but there is some error when running. my box is running fc12.

Any suggestions?

share|improve this question

migrated from Aug 3 '12 at 1:47

This question came from our site for professional and enthusiast programmers.

this belongs elsewhere... – Daniel A. White Aug 3 '12 at 1:43
up vote 2 down vote accepted

If you are using a standard distribution, then I would recommend reinstalling it first (after grabbing all of your data and putting it on an external hard drive). That way, you can be sure you have all needed packages. If not, then you should at least reinstall RPM in case it has removed part of itself, and consider rebuilding the entire computer.

Then, if you have a list of all your previous RPM-installed packages, I would reinstall each of them (even those that still appear to be installed, as they may have been partially removed). If you didn't have such a list, then you'll just need to remember what you had installed yourself. Fortunately, reinstalling the distribution should have taken care of all the required packages so your computer should at least be usable.

If your box was not based on a distribution and you got all the packages using RPM, then you should check everything. Any package may have been partially removed. Again, this is why I recommended rebuilding in the first paragraph.

share|improve this answer
Thanks for this detailed posy, Daniel. – whatacold Aug 3 '12 at 4:27
Thanks for this detailed posy, Daniel. My box runs a standard Fedora 12 installed through iso file.And all the initial RPMs installed is chosen through the catagory (like Office, Software Development) of the installing wizard, some RPMs like VirtualBox was installed before when needed, so is there a list of RPM-installed packages existing? my /home is mounted through a seperated partion, so if there is no choice finally, reinstalling the whole system is also fine. – whatacold Aug 3 '12 at 4:47
Since /home is a separate partition, I strongly recommend upgrading or reinstalling as a first resort instead of a last resort. When you do something like this, that really would be easier, and it's the only way to be sure everything is fully installed. You may still want to back up other files, like some in /etc, but why would you want to recover instead of reinstalling in this circumstance? I do not know if there's a list of the installed programs other than rpm -q, but that probably is up-to-date enough to not show all the software you accidentally uninstalled. – Daniel H Aug 3 '12 at 7:16
OK, I'll try reinstalling when I reach my box.BTW, reinstalling means to install the system from scratch right? The reason why asking is that I remembered there is a recovery or reinstall option within steps of the installing wizard, but I'm not very sure though. – whatacold Aug 3 '12 at 10:51
Yes, that is what I meant. Honestly, I wouldn't trust any other procedure at this point. That may just be because I'm still active in the Windows world also, but I doubt I'd ever trust anything other than a complete reinstall when recovering from this, or an "rm -rf /", or anything similar. – Daniel H Aug 3 '12 at 16:00

You can't really reinstall the system since it's so old the media will be very hard to find. Best thing to do is to do that upgrade you've been putting off. Fedora has a very short 1-year lifecycle; you're expected to upgrade the distribution at least annually.

share|improve this answer
Yeah, I think it's kind of old too, And I try to find material about Fedora upgrading but failed to find valuable ones. And I also grabbed one much more newer kernel and compiled myself, but it turned out booting error with this new kernel. So do you have some kind of material about upgrading at hand? Thanks in advance. – whatacold Aug 3 '12 at 10:58
Oh, I forgot to mention that I still keep the ISO image, so it won't be that hard to reinstall it. – whatacold Aug 4 '12 at 0:31

You must log in to answer this question.

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