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?

  • I assume you don't have a (Time Machine) backup? – n1000 May 24 '15 at 15:55
  • Not on this machine unfortunately – Dipole May 24 '15 at 15:56
  • I guess this question solves your problem. @fartheraway: It does, unless you exclude them. – n1000 May 24 '15 at 16:09
  • I stand corrected – fartheraway May 24 '15 at 16:22
  • 1
    No I wasn't sure but after digging around some of the forums and responses it seems like the Python I deleted is the one that is used by the OS and as such 'breaks' it. I'm not sure if these can be replaced by an ordinary Python installation. In any case it was a problem easily solved! – Dipole May 24 '15 at 21:44
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>
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.

  • 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 2:30

You must log in to answer this question.

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