简体   繁体   中英

Installing ghc cabal libraries on OSX 10.11 El Capitan, gcc permission denied error

When installing cabal packages on OSX 10.11 El Capitan, I get a permission error even though I am using an administrator account.

cabal: /usr/bin/gcc: permission denied

Changing it with chmod command to +rw or adding my account to root group doesn't fix the permission error. I'm able to run gcc --version just fine.

After much searching and scouring through the interwebs, I stumbled upon a discussion over at Cabal issue tracker. Someone's answer mentioned the rootless feature with El Capitan causing problems.

Here's how to turn off the rootless feature.

  1. Restart your machine. Press cmd+R until you see the apple logo
  2. Open the terminal, by going to Utilities > Terminal
  3. Type in csrutil disable; reboot csrutil disable; reboot and hit return
  4. Wait for your osx to reboot itself and then proceed with continuing your cabal installation(s).

Reference:

  • Cabal Issue #2653 - ar permission errors on OS X 10.11 El Capitan with GHC 7.8.4
  • Quora - How do I turn off the rootless in OS X El Capitan 10.11?
  • OSX Daily - How to Disable System Integrity Protection (rootless) in OS X El Capitan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM