3

When trying to copy an application into /Applications, I accidentally copied MyApp.app/Contents into /Applications, turning it into an executable package instead of a folder.

I have removed /Applications/Contents and made the app accessible as it should be (/Applications/MyApp.app/Contents), but /Applications did not revert to its former glory.

Currently, if I navigate to Applications in finder, it opens a terminal into /Applications :(

Edit: I realized Applications is now of type "package". I followed the directions here: http://www.switchingtomac.com/tutorials/how-to-restore-a-folder-that-has-turned-into-a-package-in-os-x/ to no avail.

3

OK - this is an odd one. The most straightforward solution would be to use Time Machine to restore /Applications from the backup prior to it becoming marked as a package and not as a folder.

Barring that, You will need to boot into single user mode and delete /Application/Contents and perhaps some other files (it's hard to know what exactly else got messed up) by mounting the filesystem in read/write mode.

 /sbin/mount -uw /
 rm -rf /Applications/Contents
 # and optionally
 mv /Applications /badApplication_package

Alternatively, you could try rebooting with Command R and just reinstalling the OS - hoping that /Applications gets corrected. If you were worried about the rm command, you could also rename /Applications and reinstall your OS - hand moving back just the Apps you need being careful not overwrite things again.

This is a rare problem to face - so congratulations on forcing yourself to learn how packages and apps get made on OS X the hard way.

  • 1
    I think this did the trick: mv /Applications /badApplication_package && mkdir /Applications && mv /badApplication_Package/* /Applications – mbarrows Dec 23 '12 at 18:18
2

/Applications/Contents/ shouldn't normally exist, so it's unlikely that anything was overwritten. It's probably safe to remove it from Terminal:

sudo rm -r /Applications/Contents/
  • Thanks for pointing this out, I have revised the question. Unfortunately it didn't work – mbarrows Dec 23 '12 at 17:55
  • What does ls -ld /Applications /Applications/Contents return (add result to the question please)? – nohillside Dec 23 '12 at 18:05

You must log in to answer this question.

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