macos 修复损坏的 Macport

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/335291/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 05:58:48  来源:igfitidea点击:

Fixing broken Macports

macososx-leopardmacports

提问by rebra

I just tried (for the first time, I might add) a

我刚试过(第一次,我可能会补充)一个

port upgrade installed

端口升级已安装

in Macports, and I'm afraid I might come to regret it: A lot of errors -- specially regarding X11 and Python.

在 Macports 中,恐怕我会后悔:很多错误——特别是关于 X11 和 Python。

Here's a typical error message regarding python:

这是关于 python 的典型错误消息:

---> Activating python24 2.4.5_4+darwin_9 Error: Activating python24 2.4.5_4 failed: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4 already exists and does not belong to a registered port. Unable to activate port python24.

---> 激活 python24 2.4.5_4+darwin_9 错误:激活 python24 2.4.5_4 失败:图像错误:/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4 已经存在并且不存在属于注册端口。无法激活端口 python24。

My question: Should I expect a bit of trouble? And: Any hints on fixing these errors?

我的问题:我应该期待一些麻烦吗?以及:关于修复这些错误的任何提示?

I did do "sync" and "selfupdate" before upgrading.

在升级之前,我确实做了“同步”和“自我更新”。

回答by casademora

Usually, when my macports installation starts going nutty (usually because I goofed it up), I delete the /opt folder and reinstall. I'm just lazy, i guess. From what it looks like though, you are trying to reinstall a new port over an old/existing folder.

通常,当我的 macports 安装开始变得疯狂时(通常是因为我搞砸了),我会删除 /opt 文件夹并重新安装。我只是懒惰,我猜。但是,从它的外观来看,您正在尝试在旧的/现有文件夹上重新安装新端口。

Have you tried Porticus? It will do a good job of telling you which ports are installed and active. Perhaps if you deactivated a current python port, and installing the new one, that can get you moving again.

你试过Porticus吗?它将很好地告诉您哪些端口已安装并处于活动状态。也许如果您停用当前的 python 端口并安装新的端口,那可以让您再次前进。

回答by Alastair

If, as the error message indicates, that file exists in the /opt directory and does not belong to a registered port, you'd have to wonder how it got there. Maybe left over from a previous, possibly botched, installation?

如果如错误消息所示,该文件存在于 /opt 目录中并且不属于已注册的端口,则您必须想知道它是如何到达那里的。也许是从以前的,可能是拙劣的安装中遗留下来的?

Either way, I don't see the harm in just deleting the file in question (and, from the looks of it, probably the entire /opt/local/Library/Frameworks/Python.framework/Versions/2.4 directory)

无论哪种方式,我都看不到删除相关文件的危害(并且,从它的外观来看,可能是整个 /opt/local/Library/Frameworks/Python.framework/Versions/2.4 目录)

Generally speaking, to resolve problems like this you should contact the port maintainer, or ask on the macports mailing list.

一般来说,要解决这样的问题,您应该联系端口维护者,或者在 macports 邮件列表上询问。

回答by dman

I also recently got this error message

我最近也收到此错误消息

[...] already exists and does not belong to a registered port

in my case because I was trying to use Macports to install Putty(to support FireFTP). Anyway, for the past year I've been using 'fink' and apt-geton Leopard, because I'm more familiar with Debian/Ubuntu. So, enough background.

就我而言,因为我试图使用 Macports 来安装Putty(支持FireFTP)。不管怎样,在过去的一年里,我一直在使用 'fink' 和apt-getLeopard,因为我更熟悉 Debian/Ubuntu。所以,足够的背景。

The thing is, I had a library (expat) installed through apt-getthat macports wanted to upgrade. But it was registered using a totally different, competing package manager. THAT is what this message meant to me. Makes sense. Upgrading via apt-getdidn't get me to a high enough version, so we instead use FORCE to make the upgrade go through.

问题是,我通过apt-get想要升级的 macports安装了一个库 (expat) 。但是它是使用完全不同的竞争包管理器注册的。这就是这条信息对我的意义。说得通。升级 viaapt-get并没有让我达到足够高的版本,所以我们改为使用 FORCE 来完成升级。

For me, sudo port -d -f install expatpushed the upgrade through, over-wrote the apt version, and allowed me to progress.

对我来说,sudo port -d -f install expat推动升级,覆盖 apt 版本,让我进步。

Here's hoping it hasn't damaged other things in the Debian checkouts in doing so.

希望这样做不会损坏 Debian 结帐中的其他内容。

回答by A K M Mahmudul Hoque

I had broken registry problem. I simply tried "sudo port -d -f uninstall program". Program referes to the program having broken registry.

我打破了注册表问题。我只是尝试了“sudo port -d -f 卸载程序”。程序是指注册表损坏的程序。

回答by ashkrosh

cleaning /opt/local and reinstalling macports worked fine for me on snow leopard.

清理 /opt/local 并重新安装 macports 对我来说在雪豹上工作得很好。

回答by Simon

Mac OS X 10.4.11 ships with Python 2.4 (not sure about Leopard). Its path is /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4, so you might not need to install at all.

Mac OS X 10.4.11 附带 Python 2.4(不确定 Leopard)。它的路径是/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4,所以你可能根本不需要安装。