0

我在尝试使用自制软件安装“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/

任何帮助,将不胜感激。

4

1 回答 1

0

Homebrew 不是为使用而设计的sudo。您永远不应该sudo在 command 之前添加前缀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在上述修复后重新安装。

于 2021-08-01T11:44:31.840 回答