Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
1  
I think this did the trick: mv /Applications /badApplication_package && mkdir /Applications && mv /badApplication_Package/* /Applications –  mbarrows Dec 23 '12 at 18:18
add comment

/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/
share|improve this answer
    
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)? –  patrix Dec 23 '12 at 18:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.