首页 技术 正文
技术 2022年11月11日
0 收藏 797 点赞 2,370 浏览 963 个字

关于homebrew使用时遇到的问题: Error: Could not symlink bin/gdb/usr/local/bin is not writable.


这是我在给我的Mac电脑安装GDB的时候遇到的问题:

我的Mac使用homebrew管理,于是我使用brew install gdb命令直接安装gdb,结果如下:

我在stackoverflow找到了发生的类似情况,经过阅读判断,找到了一下两种解决办法:

  • 如图,直接输入命令:

命令内容:

sudo chown -R `whoami`:admin /usr/local/bin
  • 如图,为了谨慎起见,使用homebrew doctor进行检测,根据其反馈来进行操作:

我认为应该使用第二中方法比较好,于是我在终端输入homebrew doctor,稍作等待得到检测结果:

如划红线部分所示,与我遇到的问题相符合,运行其解决方案:

sudo chown -R $(whoami) /usr/local/bin

在此时再link一下我的GDB:

brew link gdb

结果如下:

Already linked: /usr/local/Cellar/gdb/8.0.1

再测试一下GDB:

gdb

结果如下:

成功.

那么问题的原因是什么呢?

  • 问题出现在我之前安装OpenSSL时使用了sudo make install命令,导致了一些软件非homebrew管理,所以homebrew在Link的时候会出现问题。
  • 参考homebrew doctor如下提示:
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.
You should change the ownership and permissions of these directories.
back to your user account.

参考资料

用brew安装node遇到的问题

Error: The ‘brew link’ step did not complete successfully

homebrew could not symlink usr/local/bin is not writable

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,966
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,487
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,332
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,115
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,748
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,783