A possible solution to 'bad interpreter: operation not permitted' error on Mac OS X Lion
Out of the blue I started having an issue in my Terminal.app on Lion where downloaded scripts/applications wouldn’t run. I first noticed this when trying to setup the Android SDK.
The problem looks like this:
$ ./android: /bin/sh: bad interpreter: Operation not permitted
After a bit of Google-fu, and a bunch of Apple Support Community threads that ended in people arguing about whether or not TextEdit caused this issue, I found a cause and a solution.
It turns out that for some reason, on Mac OS X Lion 10.7.3 apple is storing a com.apple.quarantine metadata file, which prevents executable files from being executed. Why is it doing this? Probably because the executable file was downloaded from the internet? who knows?
Anyway, there is a solution:
$ xattr -rd com.apple.quarantine [directory containing the executables]
So, for me with the Android SDK, I ran the following:
$ xattr -rd com.apple.quarantine /android-sdk/
This command deletes the com.apple.quarantine metadata files, allowing you to execute the executables.
Related posts
- Making GIMP feel less like punishment
GIMP has always had an interface problem. I’m not blaming the GIMP team (they’ve built something powerful on a shoestring). They’ve been clear they’re not interested in copying Photoshop wholesale; their FAQ argues that designing around actual user research beats imitating someone else’s interface decisions. Fair enough in principle, but coming from years as a Photoshop user, that design still feels hostile to me. I’m just one user story out of many they’ve had to design for, but it still expects me to learn its own way of doing things rather than offering a config closer to what I’m used to out of the box.
- Replacing the macOS audio switcher with SwiftBar
The built-in audio output menu in macOS has always felt a bit limited. The icons aren’t very helpful, the device names can’t be customised, and if you’ve got a few different outputs, it becomes tricky to quickly tell what’s what.
- Installing Chrome OS on a Late 2009 MacBook
I’ve got an old 2009 MacBook 6,1 (A1342) kicking about in my office that I’ve been playing with on and off lately.
Discussion
- 2012
- J
thanks, it worked
- 2013
- A
Great Result…… Was having a problem with a sparseImage and executed the xattr command on the image file and the problem just went away! thanks!
- N
Thanks for posting about this.
- J
Thanks a lot, it worked!!!
- 2014
- J
dont have appropriate permissions… im on administrator account
Join the conversation
Reply from your own site with a Webmention (how?).
