Accidentally deleted python, python2, python2.7 files from /usr/bin/. Is it possible to recover them?

I accidentally deleted python, python2, python2.7 files from /usr/bin/. Now yum is also not working.

Is it possible to recover them?


You cannot recover the files, if you really deleted them. If you have no backup at hand, and you don't want to reboot from the installation disc, you can still try to copy it over from a different installation of the same OS:

cp /path/to/your/copy/python2.7 /usr/bin
ln -s /usr/bin/python2.7 /usr/bin/python

It should be the same OS and distribution for the same processor family and type.

If that fails, you can still boot from the installation disc and re-install Python.


Generally on UNIX-like systems, deleting a file means it cannot be retrieved. (Unless you are using a filesystem that has the ability to take snapshots, and you are using them.)

Restore the files from your most recent backup.