【问题标题】:Using brew to Install GNU flex on OS X but got an error "/usr/local/lib/pkgconfig is not writable."使用 brew 在 OS X 上安装 GNU flex 但出现错误“/usr/local/lib/pkgconfig is not writable.”
【发布时间】:2015-10-01 13:12:15
【问题描述】:

我需要在 OS X 下编译一些 LEX/YACC 文件(*.l)。并且需要GNU flex 作为扫描仪。

但是,我在安装 GNU flex 时被卡住了。

  1. 运行brew install flex,但出现错误:

    • Error: You must `brew link xz' before flex can be installed

    然后我运行brew link xz,还是报错:

    • Error: Could not symlink lib/pkgconfig/liblzma.pc /usr/local/lib/pkgconfig is not writable.
如何在 OS X 10.10 上正确安装 flex?这个问题是我的home brew引起的吗?

关于我的“酿造”的一些细节:

运行brew doctor

Warning: /usr/local/lib/pkgconfig isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/lib/pkgconfig

运行ls 命令 yeze@yezedeMacBook-Pro:~$ ls -la /usr/local/lib/pkgconfig total 16 drwxr-xr-x 4 root wheel 136 Mar 31 2013 . drwxr-xr-x 30 yeze admin 1020 Oct 1 21:05 .. -rw-r--r-- 1 root wheel 405 Mar 30 2013 tcl.pc -rw-r--r-- 1 root wheel 404 Mar 30 2013 tk.pc

【问题讨论】:

  • brew doctorls -la /usr/local/lib/pkgconfig 的输出是什么?
  • @xhruso00 实际上,我不太明白这个规则......您似乎已经回答了一些问题,例如“无法在 Yosemite 下安装 Xcode 5”。我觉得我的是同类型的,请问这种问题应该在哪里问呢?
  • 将它们添加到问题中。
  • 我不认为你的问题是“程序员常用的软件工具”。这就是区别
  • @xhruso00 谢谢,我会更加注意问题的质量。

标签: macos homebrew flex-lexer


【解决方案1】:

这个问题是由brew引起的。

当你得到/usr/local/lib/pkgconfig is not writable.,你应该运行:

chown [YourAccountName] /usr/local/lib/pkgconfig

然后按照说明运行brew link xz。你可能会收到这样的回复:Linking /usr/local/Cellar/xz/5.2.1... 53 symlinks created

最后,再次尝试brew install flex,它会起作用。

非常感谢@IKavanagh。

【讨论】:

  • 或者,chown $USER /usr/local/lib/pkgconfig
猜你喜欢
  • 2018-06-23
  • 2011-10-04
  • 1970-01-01
  • 2014-12-17
  • 2013-06-02
  • 2011-03-24
  • 2013-06-10
  • 2013-08-13
  • 2019-05-18
相关资源
最近更新 更多