关于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

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

  1. Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)

    centos7.5 安装mysql数据库报错 问题: [root@db04-54 scripts]# /etc/init.d/mysqld start /etc/init.d/mysqld: line ...

  2. error: <class 'xml.parsers.expat.ExpatError'>, syntax error: line 1, column 0: file: /usr/local/lib/python2.7/xmlrpclib.py line: 557

    当linux设备上开启sonar6.2时, supervisorctl status报如下错误: error: <class 'xml.parsers.expat.ExpatError'> ...

  3. python pip 使用时错误: Patal error in launcher:Unable to create process using '"'

    当前我的电脑配置是64位, 装有python2.7 和python 3.6 两个版本 在使用pip install mysqlclient 的时候,出现了  Patal error in launch ...

  4. inotify+rsync文件实时同步报错:usr/local/bin/inotifywait: error while loading shared libraries: libinotifytools.so.0:

    解决办法: ln -sv /usr/local/lib/libinotify* /usr/lib/ /usr/lib64/libinotifytools.so.

  5. Mac上Homebrew的使用 (Homebrew 使 OS X 更完整)

    0 Homebrew是啥? “Homebrew installs the stuff you need that Apple didn’t.——Homebrew 使 OS X 更完整”. Homebr ...

  6. Mac上Homebrew的使用——Homebrew 使 OS X 更完整

    0 Homebrew是啥? “Homebrew installs the stuff you need that Apple didn’t.——Homebrew 使 OS X 更完整”. Homebr ...

  7. 安装HomeBrew 失败的解决方案(Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!)

    在安装HomeBrew(或者安装成功 执行相关指令)时遇到错误提示: Error: Failure while executing: git clone https://github.com/Home ...

  8. jenkins使用时出现的问题!

      从安装到日常使用中遇到过的问题和解决方法:   背景/问题:安装时是跳过安装插件过程的,安装好后,我发现里面啥也做不了,连个git的插件都无法下载. 方法:在jenkins的主界面,打开系统管理= ...

  9. Mac下Mysql启动异常["ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"]

    在mac下使用brew安装mysql,之前没有使用过,今天启动的时候发现启动不了 huijundeMacBook-Pro:bin huijunzhang$ mysql ERROR (HY000): C ...

随机推荐

  1. HomeBrew 使用国内数据源

    使用中科大源 1.替换默认源 替换USTC镜像: cd "$(brew --repo)" git remote set-url origin https://mirrors.ust ...

  2. Hive安装报错

    安装好hive后在bin路径下输入hive报错: [ERROR] Terminal initialization failed; falling back to unsupported 原因是hado ...

  3. 本地缓存和redis

    项目中的传统架构在服务启动时 读取数据库的大部分数据到本地内存,在看到redis的作用时发出疑问,到底有什么样的区别以及怎么选择呢,下面是别人的回答 使用本地缓存快还是使用redis缓存好? Redi ...

  4. JavaScript浏览器对象模型(BOM)之history对象

    history 对象是 window 对象的属性,它保存着用户上网的记录,从窗口被打开的那一刻算起. 一.history对象的属性 可以通过判断 history.length,得到是否有历史记录和记录 ...

  5. ubuntu卸载virtualbox

    本想在ubuntu下virtualbox,可惜出错了,需要卸载后再安装,只能百度拼凑后再安装: 1.首先是执行删除命令:sudo apt-get remove virtualbox*( 这样就不用去查 ...

  6. ServletContextListener在Springboot中的使用

    ServletContextListener是servlet容器中的一个API接口, 它用来监听ServletContext的生命周期,也就是相当于用来监听Web应用的生命周期.今天我们就来说说如何在 ...

  7. disconf实践(三)基于XML的分布式配置文件管理,自动reload

    上一篇介绍了基于xml的非自动reload的分布式配置文件管理,这一篇介绍自动reload的方式(基于disconf实践二). 1. 修改RedisConfig.java package org.sp ...

  8. java基础——回文数判断

    /** * 题目描述: * 有这样一类数字,他们顺着看和倒着看是相同的数,例如:121,656,2332等,这样的数字就称为:回文数字.编写一个函数,判断某数字是否是回文数字. * 要求实现方法: * ...

  9. CentOS7 安装 Docker 以及 Shipyard管理端

    简介: Docker 是一个开源工具,它可以让创建和管理 Linux 容器变得简单.容器就像是轻量级的虚拟机,并且可以以毫秒级的速度来启动或停止. Docker 帮助系统管理员和程序员在容器中开发应用 ...

  10. python3 使用pyinstaller打包可执行程序

    步骤 1.使用pip安装pyinstaller pip install pyinstaller 2. 使用pyinstaller打包程序 pyinstaller -F xxx.py pyinstall ...