Mac安装Homebrew遇dyld错误:@rpath/libssl.1.0.0.dylib未加载,已查相关问题无果
Hey there, sorry to hear you're stuck with this libssl error while trying to install Homebrew on your Mac—let's walk through some solid fixes that should get you up and running:
Fixes for the
dyld: Library not loaded: @rpath/libssl.1.0.0.dylib Error 1. Reinstall the Required OpenSSL Version
Homebrew often relies on the older OpenSSL 1.0.x library for certain operations, so let's make sure it's properly installed and linked:
- First, tap the Homebrew versions repository if you haven't already:
brew tap homebrew/versions - Install OpenSSL 1.0.0 specifically:
brew install openssl@1.0.0 - Create symbolic links to the missing libraries so your system can locate them:
sudo ln -s /usr/local/opt/openssl@1.0.0/lib/libssl.1.0.0.dylib /usr/local/lib/ sudo ln -s /usr/local/opt/openssl@1.0.0/lib/libcrypto.1.0.0.dylib /usr/local/lib/
2. Update Your Shell Path and Refresh Homebrew
Sometimes the issue is that your shell isn't pointing to the right library paths. Let's fix that:
- Add the OpenSSL 1.0.0 path to your shell profile (use
~/.bash_profileinstead of~/.zshrcif you're using Bash):echo 'export PATH="/usr/local/opt/openssl@1.0.0/bin:$PATH"' >> ~/.zshrc echo 'export LDFLAGS="-L/usr/local/opt/openssl@1.0.0/lib"' >> ~/.zshrc echo 'export CPPFLAGS="-I/usr/local/opt/openssl@1.0.0/include"' >> ~/.zshrc - Reload your shell profile to apply the changes:
source ~/.zshrc - Rehash Homebrew to refresh its internal links:
brew rehash
3. Do a Clean Reinstall of Homebrew
If the above steps don't resolve the error, a fresh install might clear up any lingering issues:
- Uninstall Homebrew completely using the official uninstall script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" - Then reinstall Homebrew with the latest official script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - After reinstalling, run
brew doctorto check for any remaining problems:brew doctor
4. Check for Conflicts with Other Package Managers
If you have other package managers like MacPorts installed, they might be conflicting with Homebrew's libraries:
- Temporarily comment out any lines related to other package managers in your shell profile
- Reload your shell and try installing Homebrew again
- If this works, adjust your shell path to prioritize Homebrew over other package managers to avoid future conflicts
内容的提问来源于stack exchange,提问作者Alex Germain
相关产品推荐
相关产品推荐

