I removed all the packages in CentOS by chance using yum remove mktemp removed almost all the bin packages including rpm and openssh. The terminal that I'm connected is the only one which is the gate for me. If I disconnect I can't do ssh too. Any way to roll it back and get the packages installed.? Please help!!
How did you manage to do that? I can't reproduce this on CentOS 6; the following error occurs (after several seconds of listing all the packages it's going to remove, which should have been a clue):
Anyway, on with the answer...
If you somehow still have
will show your most recent transactions, each with a number, and then
will undo the transaction listed.
If you don't have a working