A disaster just occurred to me after I ran the command yum remove python and now I can't boot the server up anymore.
How it happened: I tried updating some apps via yum on my CentOS 5 VPS and the command was failing due to some weird python 2.4 error. I noticed that my version of python was old and I tried reinstalling it by first removing it, and so I did yum remove python.
After that it asked me something about removing dependencies and it looked like nothing I could miss so I clicked Y.
So the aftermath of that was that I was unable to run any command what so ever. I even tried cd /var/www but it said something like "command does not exist in /usr/bin". When I used tab to see folder navigation suggestions, the file structure still seemed to be there (at least the /var/www bit which is really important to me).
After that I tried restarting the vps (from the admin panel since reboot command did not work) and now it doesn't boot anymore.
Now my question is: how can a command like that possibly destroy my server like this?
# dpkg --remove dpkgspits outdpkg: error processing dpkg (--remove): this is an essential package; it should not be removed. If I add--force-allto dpkg's command line,dpkgspits out a whole bundle of warnings and proceeds to remove itself, along with breaking about two dozen other packages that depend ondpkg. On a real system, I'm pretty sure you'd have some trouble recovering from that, but you probably could (there's little magic to.debs); CentOS may or may not be similar in this regard. – user Apr 16 '17 at 20:35aptdoesn't provide protection against this sort of mistake, the waydpkgapparently does. – Kyle Strand Apr 18 '17 at 23:48aptis really just a convenience utility; a very useful convenience utility, mind you, but perfectly possible to get along without in a pinch. The real trouble begins when you removedpkg. That said, as I alluded to above, because .deb files are really just compressed archives of program binaries plus some metadata and scripts, with some work but not too much difficulty you probably could get back to a working system manually without needing to rundpkg, at least to the point that you can rundpkg. – user Apr 20 '17 at 07:28emerge --ask --unmerge portagegivesNot unmerging package sys-apps/portage since there is no valid reason for Portage to unmerge itself.– VL-80 Apr 20 '17 at 12:52yum-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory– Muaaz Khalid Aug 07 '17 at 10:15