使用brew安装openconnect时出现问题

时间:2021-07-30 09:08:06

标签: homebrew symlink openconnect

我在尝试使用自制软件安装“openconnect”时被卡住了,因为我不允许创建指向 /usr/local/share/locale/ca/LC_MESSAGES 的符号链接。 我运行的是 Big Sur 11.4 版。

以下是我尝试过的:

(base) MacBook-Pro-5:Data Eigil$ brew uninstall --force openconnect

Uninstalling openconnect... (54 files, 2.8MB)

(base) MacBook-Pro-5:Data Eigil$ brew cleanup -s openconnect

Removing: /Users/Eigil/Library/Caches/Homebrew/openconnect--8.10... (971.3KB)

(base) MacBook-Pro-5:Data Eigil$ brew cleanup --prune-prefix

(base) MacBook-Pro-5:Data Eigil$ brew install openconnect

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 8 formulae.
==> Updated Casks
Updated 1 cask.

==> Downloading https://ghcr.io/v2/homebrew/core/openconnect/manifests/8.10
Already downloaded: /Users/Eigil/Library/Caches/Homebrew/downloads/c979ec1baea5847f748962ba42b95bce88cef90599731a131c5588090c9c066b--openconnect-8.10.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openconnect/blobs/sha256:9755c4ea66ed9c8aa1f1ee966c932ec2be37849887636d8f65a920f20c16ec55
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:9755c4ea66ed9c8aa1f1ee966c932ec2be37849887636d8f65a920f20c16ec55?
######################################################################## 100.0%
==> Pouring openconnect--8.10.big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/locale/ca/LC_MESSAGES/openconnect.mo
/usr/local/share/locale/ca/LC_MESSAGES is not writable.

You can try again using:
  brew link openconnect
==> Summary
?  /usr/local/Cellar/openconnect/8.10: 54 files, 2.8MB

建议的解决方案不起作用(仍然是因为我无法写入 LC_MESSAGES)。 sudo 也不允许出现在该目录中。

ls -l /usr/local/share/locale/ca/

给出:

total 0

drwxr-xr-x  3 root  wheel  96 Jun 28 11:34 LC_MESSAGES/

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

Homebrew 不适合与 sudo 一起使用。永远不要在命令 sudo 之前添加 brew,这会改变一些与 brew 相关的文件的所有权。

结果是某些文件现在不属于您,而是属于 root。您必须修复权限。

# For x86 Mac
sudo chown -R "$(whoami):admin" /usr/local/*

# For M1 mac
sudo chown -R "$(whoami):admin" /opt/homebrew/*

# NOTE:
# * in /usr/local/* is used on purpose to only match the sub folders, files
# The command will take some time, wait patiently.

您最好在上述修复后重新安装 openconnect

相关问题