微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

macos – 即使使用sudo也无法写入/ usr

这是我的问题:

sudo PHP -d detect_unicode=0 go-pear.phar

…应该让我以root身份运行并修改/ usr& /usr/share目录,但我明白了:

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($PHP_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. System manual pages directory                 : /usr/man
11. Tests directory                               : /usr/tests
12. Name of configuration file                    : /private/etc/pear.conf

1-12, 'all' or Enter to continue: 
Unable to create PHP code directory ($PHP_dir) /usr/share/pear.
Run this script as root or pick another location.

为什么sudo没有给我root权限? *注意:*我在轮组,虽然这不应该有这个有趣的sudo行为.

Gabbar-Singh:~ anadi$id anadi
uid=XXX(anadi) gid=XX(staff) groups=XX(staff),0(wheel)

解决方法:

您正尝试在/ usr中安装受SIP(系统完整性保护)保护,这是10.11引入的功能(请参阅
What is the “rootless” feature in El Capitan, really?详情).

请改用/usr/local,这是用于用户端安装的位置.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐