在 Mac 命令行上使用“wget”时如何修复“dyld:库未加载”?

问题描述 投票:0回答:3

我使用的是 Mac OS Big Sur (v 11.4)。我尝试在命令行上使用“wget”,我明白了

$ wget http://localhost:8000/user/testuser
dyld: Library not loaded: /usr/local/opt/nettle/lib/libnettle.6.dylib
  Referenced from: /usr/local/bin/wget
  Reason: image not found
Abort trap: 6

即使运行“brew install wget”并重新启动计算机后,我仍然收到上述错误。如何让“wget”正常运行?这是wget安装的路径...

$ which wget
/usr/local/bin/wget

编辑:响应给出的答案,这里是输出...

$ brew install homebrew/core/wget
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 6 taps (phinze/cask, homebrew/core, homebrew/cask, homebrew/services, pivotal/tap and ethereum/ethereum).
==> New Formulae
airspyhf              cargo-llvm-lines      cilium-cli            f2                    h2c
basis_universal       cargo-outdated        datree                fst                   vite
bubblewrap            chrpath               esbuild               [email protected]               vue-cli
==> Updated Formulae
Updated 883 formulae.
==> Deleted Formulae
procyon-decompiler
==> New Casks
infra             infra             mimestream        mimestream        sigmaos           sigmaos
==> Updated Casks
Updated 292 casks.
==> Deleted Casks
agfeo-dashboard                                         macintosh-explorer
agfeo-dashboard                                         macintosh-explorer
axe-electrum                                            modulair
axe-electrum                                            modulair
boonzi                                                  noraswitch
boonzi                                                  noraswitch
colormunki-photo                                        obyte
colormunki-photo                                        obyte
dnagedcom                                               playnow
dnagedcom                                               playnow
dragthing                                               plecs-standalone
dragthing                                               plecs-standalone
eaccess                                                 privatus
eaccess                                                 privatus
elpki                                                   pro-fit
elpki                                                   pro-fit
finisher-fluxx                                          qtum
finisher-fluxx                                          qtum
finisher-micro                                          qyooo
finisher-micro                                          qyooo
finisher-neo                                            s3stat-setup
finisher-neo                                            s3stat-setup
flow-e                                                  scrooo
flow-e                                                  scrooo
fluxcenter                                              simplelink-msp432e4-sdk
fluxcenter                                              simplelink-msp432e4-sdk
fm3-edit                                                stageplotpro
fm3-edit                                                stageplotpro
imarisviewer                                            tbs-studio
imarisviewer                                            tbs-studio
instant-articles-builder                                thetube
instant-articles-builder                                thetube
instasizer                                              unity-appletv-support-for-editor
instasizer                                              unity-appletv-support-for-editor
jabt-flow                                               unity-linux-il2cpp-support-for-editor
jabt-flow                                               unity-linux-il2cpp-support-for-editor
jidusm                                                  unity-macos-il2cpp-support-for-editor
jidusm                                                  unity-macos-il2cpp-support-for-editor
lightwright                                             wanna
lightwright                                             wanna
locklizard-safeguard-viewer                             zbuc-imgur
locklizard-safeguard-viewer                             zbuc-imgur

==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1l
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:ff8b2a965c680b4d9baccd60e799d0989e7dc
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ff8b2a965c680b4d9baccd60e7
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.21.1_1
Already downloaded: /Users/davea/Library/Caches/Homebrew/downloads/44061bb7a2f7bbbbbddd0901da6885f571bb53671d2ef9f3b29faa13cdc50ac7--wget-1.21.1_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:307217b813330eda365570d7540aa2da69c678b6c4b7
Already downloaded: /Users/davea/Library/Caches/Homebrew/downloads/2229e2908e6815b9ceac4ac5af316c49215750a1c6d0bdc10b3946b273ee648d--wget--1.21.1_1.big_sur.bottle.tar.gz
==> Installing dependencies for wget: [email protected]
==> Installing wget dependency: [email protected]
==> Pouring [email protected]_sur.bottle.tar.gz
Error: Directory not empty @ dir_s_rmdir - /usr/local/opt/openssl
command-line homebrew wget macos-big-sur dylib
3个回答
1
投票

这很有趣。来自 homebrew-core 的

wget
,Homebrew 的默认软件包存储库,根本不依赖于
nettle

您从哪里安装

wget
?卸载 wget 并从默认的 pkg 存储库重新安装它。

brew uninstall -f wget
# tell brew to get wget from homebrew-core explicitly
brew install homebrew/core/wget

0
投票

不知道您是否设法解决了这个问题,但我遇到了类似的问题,在这里找到了解决方法:https://github.com/Homebrew/discussions/discussions/3920

brew reinstall z3

0
投票

在某些情况下,重新安装

wget
可以解决问题。就我而言,简单地重新安装
wget
并不能解决问题。在尝试了无数方法之后,唯一有效的方法是重新安装
brew
,然后安装
wget
,即:

  1. 卸载
    brew
    :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

  1. 安装
    brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
© www.soinside.com 2019 - 2024. All rights reserved.