如何修复Mac上的libiconv错误? [英] How to fix libiconv error on Mac?
问题描述
我已经使用以下命令从Mac卸载了端口:
I have uninstall port from Mac with this comand:
sudo port -fp uninstall installed
然后当我使用wget下载文件时,它显示给我:
Then when I use wget to download file,it shows me:
dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /opt/local/bin/wget
Reason: Incompatible library version: wget requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Trace/BPT trap: 5
怎么办?
※Mac OS X 10.7.5
※ Mac OS X 10.7.5
我跑步时
otool -L $(which wget)
它给了我
/opt/local/bin/wget:
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.19.0)
/opt/local/lib/libgnutls.26.dylib (compatibility version 49.0.0, current version 49.3.0)
/opt/local/lib/libtasn1.3.dylib (compatibility version 5.0.0, current version 5.13.0)
/opt/local/lib/libgcrypt.11.dylib (compatibility version 19.0.0, current version 19.0.0)
/opt/local/lib/libgpg-error.0.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.7)
/opt/local/lib/libidn.11.dylib (compatibility version 18.0.0, current version 18.8.0)
推荐答案
显然,当您从MacPorts安装了libiconv
时,您是在本地构建并安装了wget
的副本,因此它可以动态链接到您现在已经拥有的该库删除.如果要删除所有MacPorts痕迹,则需要重建wget
的副本.
Apparently you built and installed a copy of wget
locally while you had libiconv
installed from MacPorts so it dynamically links to that library which you've now removed. If you want to remove all traces of MacPorts, you'll need to rebuild that copy of wget
.
否则,您可以使用MacPorts安装wget
的副本,该副本还将安装所有依赖项,例如libiconv
.
Otherwise, you could install a copy of wget
with MacPorts which will also install all dependencies like libiconv
.
sudo port selfupdate
sudo port clean wget
sudo port install wget
或者,您可以使用Apple随OS X提供的curl
来代替wget
.
Or, instead of wget
, you could use curl
which Apple supplies with OS X.
更新:根据您的更新,似乎您使用的是MacPorts安装的wget
.您已经设法以某种方式使依赖项不同步. (为什么使用port -fp uninstall installed
?)现在建议您尝试:
UPDATE: Based on your update, it appears you are using a MacPorts-installed wget
. Somehow you've managed to get the dependencies out of sync. (Why use port -fp uninstall installed
?) Suggest you now try:
sudo port selfupdate # if not run recently
sudo port clean libiconv
sudo port upgrade --force libiconv
强制将libiconv
升级到当前版本.
to force an upgrade of libiconv
to the current version.
更新[2014-12]:再次讨论此问题,这也可能是由于不完整的MacPorts端口文件未在libiconv
上注册wget
端口依赖项.我已经打开了一个问题. [...] MacPorts项目回答说,这可能是由于在升级到新版本的OS X时未遵循MacPorts迁移说明的结果;有一个此处提供了libiconv
兼容性的MacPorts问题热点列表条目.
UPDATE [2014-12]: Revisiting this, the problem may also be due to an incomplete MacPorts port file that doesn't register the wget
port dependency on libiconv
. I've opened an issue about it. [...] And the MacPorts project answers that this may be a result of not following the MacPorts migration instructions when upgrading to a new release of OS X; there is a MacPorts problem hotlist entry for libiconv
compatibilities here.
无论如何,从源代码重新安装wget
可能是可行的.
In any case, what may work is to reinstall wget
from source.
sudo port selfupdate
sudo port -f uninstall wget
sudo port -s install wget
如果这没有帮助,您可能需要阅读迁移说明,并确保升级后,您已经重新安装了所有端口.
If that doesn't help, you may want to read the migration instructions and make sure you've re-installed all your ports after upgrading.
这篇关于如何修复Mac上的libiconv错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!