5

I managed to delete my python in usr/bin by foolishly doing sudo rm /usr/bin/python and now it seems like I need to reinstall my OS.

First off is this necessary? And secondly is there an easy way to do this without having to erase everything on my disk?

In other words ideally I would like my programs I have installed to remain there after reboot saving me the trouble of having to install everything again to date. Is this possible?

grg
  • 201,078
Dipole
  • 173

2 Answers2

8

This question probably has all the answers for you. In short there is no easy way. Your options are:

  1. Recover the files from a (Time machin) Backup, if existent.
  2. Reinstall OSX, e.g. from the Recovery mode pressing Command+R at the startup screen
  3. Copy the missing files from the Recovery partition (check if the partition is up to date first). E.g. by doing cp -a /bin /Volumes/<your disk name>
n1000
  • 7,714
1

If it's only one file you need, you can DL your version of OS X, and create a USB installer. Then install the new OS X on another flash drive. This one is called a bootable flash drive. Then go back to your troubled system and mount the bootable drive. Find the file you need and voila.

fartheraway
  • 5,066
  • Thanks. But it seems easier to just reinstall OS X by restarting and then cmd+R to get to OS X utilities screen. By selecting 'reinstall a new copy of OS X' will this just change the system and leave my installations alone? – Dipole May 24 '15 at 16:00
  • If by "my installations" u mean your apps? My guess is no. Migration tools only show up in an upgrade. Doing it ur way might wipe Everything clean. Back up should u try. – fartheraway May 24 '15 at 16:04
  • I mean for example some programs I have installed from source on my system. I'm guessing not. – Dipole May 24 '15 at 16:07
  • 1
    @Jack , the reinstall with cmd-r is the way to go. It reinstalls in place - leaves all your 'extras' (applications, settings, etc). I'd still backup to time machine first - but I've had to run the reinstall, and was very pleased with the results (and didn't have to use my time machine backup at all). – evilblender May 27 '15 at 02:30