LoginSignup
291
224

More than 5 years have passed since last update.

初心者向け MacでOperation not permittedの解決方法

Last updated at Posted at 2017-03-11

概要

  • OS X 10.11 El Capitanより追加されたセキュリティ機能、SIP(System Integrity Protection)によって以下の領域がガードされています。
  • /bin
  • /sbin
  • /System
  • この配下では,rootユーザでも書き込みできません。

事例

例えば以下のコマンドを実行するとエラーが表示されます。

$ sudo mv /usr/bin/vim /usr/bin/old_vim
mv: rename /usr/bin/vim to /usr/bin/old_vim: Operation not permitted

解決手順

  • Macを一度シャットダウンします。
  • 立ち上げる時に、command + R を押し続けてマークが表示されたら離します。
  • しばらくするとリカバリーモードが起動します。
  • リカバリーモードになったら、「主に日本語を使用する」を選択して、次にいきます。

20170311_224933.jpg

  • ユーティリティからターミナルを起動します。

20170311_225011.jpg

20170311_225857.jpg

  • ターミナルから以下のコマンドを実行します。
$ csrutil status
  • その結果、以下が表示されます。
  • enabled というのが、エラーの原因です。
System Integrity Protection status: enabled.
  • 以下のコマンドで設定を変更します。
$ csrutil disable
  • その結果、以下が表示されます。
Successfully disabled System Integrity Protection. Please resart the machine for the changes to take effect.
  • 再起動するために以下のコマンドを実行します。
$ reboot
  • これで再起動されれば、設定が変更され、エラーが解決できます。
291
224
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
291
224