我无法升级我的 MacPorts。我似乎遇到了注册表问题。我提交了工单这里。当我这样做时,sudo port upgrade outdated
我收到以下错误:
DEBUG: Executing org.macports.uninstall (iso-codes)
---> Unable to uninstall iso-codes @3.34_0, the following ports depend on it:
Error: org.macports.uninstall for port iso-codes returned: an invalid entry was passed
DEBUG: Error code: registry::invalid
DEBUG: Backtrace: an invalid entry was passed
while executing
"$depport name"
(procedure "registry::check_dependents" line 19)
invoked from within
"registry::check_dependents $port ${uninstall.force} "uninstall""
(procedure "registry_uninstall::uninstall" line 83)
invoked from within
"registry_uninstall $subport $version $revision $portvariants [array get user_options]"
(procedure "portuninstall::uninstall_main" line 3)
invoked from within
"$procedure $targetname"
Warning: targets not executed for iso-codes: org.macports.uninstall
Please see the log file for port iso-codes for details:
/opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_iso-codes_3.34_0/iso-codes/main.log
DEBUG: an invalid entry was passed
while executing
"$depport name"
(procedure "registry::check_dependents" line 19)
invoked from within
"registry::check_dependents $port ${uninstall.force} "uninstall""
(procedure "registry_uninstall::uninstall" line 83)
Warning: Failed to execute portfile from registry for iso-codes @3.34_0
---> Unable to uninstall iso-codes @3.34_0, the following ports depend on it:
DEBUG: an invalid entry was passed
while executing
"$depport name"
(procedure "registry::check_dependents" line 19)
invoked from within
"registry::check_dependents $port ${uninstall.force} "uninstall""
(procedure "registry_uninstall::uninstall" line 83)
invoked from within
"registry_uninstall::uninstall $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) [array get options]"
Error: Uninstall iso-codes 3.34_0 failed: an invalid entry was passed
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
另一位 MacPorts 用户也遇到了同样的问题,但似乎没有找到答案。这似乎是与注册表 - sqlite 数据库相关的错误。我一直在尝试找出如何解决这个问题。但一直没有成功。如果没有修复,我无法继续,即使卸载所有端口以进行新的全新安装也不起作用。
我怎么能够
- 修复此问题
- 如果无法修复,则在无法卸载端口时重新安装 MacPorts
答案1
解决方案摘要卸载失败:“传递了无效条目”:
步骤 1:使用以下命令打开 Macports 注册表sqlite3
:
sudo sqlite3 /opt/local/var/macports/registry
第 2 步:找到有问题的端口:
sqlite> SELECT * FROM dependencies WHERE id NOT IN (SELECT DISTINCT id FROM ports);
618|apr|
618|expat|
618|libiconv|
618|db46|
618|sqlite3|
步骤 3:删除有问题的行:
DELETE FROM dependencies WHERE id = 618;
DELETE FROM files WHERE id = 618;
步骤 4:修复安装
sudo port selfupdate
sudo port upgrade outdated
请注意,id
每个安装都会有所不同!
答案2
感谢 MacPorts 人员的努力,问题已得到解决。请参阅跟踪票这里。MacPorts 注册表出现问题。不知何故,SQLite 数据库有一些必须删除的流氓依赖项。我运行了 sqlite 查询
sqlite> UPDATE dependencies SET id = 2323 WHERE id = 1407;
用 pkgconfig 使用的 ID 替换数据库中缺失端口的 ID。它工作得很好。然后我可以做
sudo upgrade outdated
再次继续升级我所有过时的端口并修复损坏的端口。现在一切都很好!