中断长时间的 MacPorts 安装

发布于 2025-01-06 01:40:58 字数 190 浏览 1 评论 0原文

我目前正在安装 qt4-mac 并且需要永远建造。我查了一下,发现安装需要 2 到 5 个小时。

有没有办法中断此安装过程,如果可以,我需要在安装后进行一些清理吗?

I'm currently installing qt4-mac and it's taking forever to build. I've searched around and I've discovered that it's going to take anywhere from 2-5 hours to install.

Is there a way to interrupt this installation process and if so do I need to do some clean-up afterwards?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

赠我空喜 2025-01-13 01:40:58

这是一个老话题了,但我想分享一下我个人的看法。

曾几何时(我猜是两年前,不确定当前的情况)我中断了 MacPorts 更新(sudo port update outdated),但没有使用 Ctrl+C (大致是 SIGINT),而是 SIGKILL,因为当时我遇到了一些硬件问题。我最终得到了一个完全损坏的安装,无法进行所有清理或恢复工作,并且我最终恢复了 /opt/local 的完整备份。

从那时起我再也不敢中断 MacPorts 安装/升级,即使使用 Ctrl+C 也是如此。

这个故事的寓意是:中断 MacPorts 安装过程可能非常危险。如果它只是运行很长时间(有时构建确实需要很长时间),请不要管它。如果您确实认为它是挂起而不是实际构建,请确保您有备份,并谨慎操作(当然,当您已经运行安装时再备份就太晚了)。

This is an old thread, but I'd like to share my personal opinion on this.

Once upon a time (two years ago I guess, not sure about the current state of affairs) I interrupted a MacPorts update (sudo port upgrade outdated) with not Ctrl+C (roughly SIGINT), but rather SIGKILL, since I was running into some trouble with the hardware at that time. I ended up with a completely broken install that defied all efforts of clean-up or recovery, and I ended up restoring a full backup of /opt/local.

I never dare to interrupt MacPorts install/upgrade since then, even with Ctrl+C's.

The moral of the story is: interrupting MacPorts installation process could be potentially pretty dangerous. Leave it alone if it is simply running for a long time (sometimes building does take forever). If you do believe it is hanging rather than actually building, make sure you have a backup, and proceed with caution (of course, it's too late to back up when you are already running the install).

握住你手 2025-01-13 01:40:58

Have you tried using control+c?

Also, I'm not entirely sure about cleanup, but according to the MacPorts docs, the command sudo port -fp uninstall --follow-dependents [your port name here] should help (this page is about uninstalling MacPorts itself, but it's the same command). I'm not sure how MacPorts treats interrupted installations and if it treats "half-installed" items as uninstallable, but it's worth a try.

猫性小仙女 2025-01-13 01:40:58

不要按 Ctrl+C

建立在 4ae1e1 的答案上,当他(她)中断发送 SIGKILL 信号的进程时,我中断了它发送实际的 SIGINT 信号,即通常的 Ctrl+C,现在还没有 MacPorts 应用程序可以运行。

所以我完全同意4ae1e1。

如果您需要您的机器

如果您需要暂停安装,例如因为您需要 CPU 可以用于其他事情,请改为发送 SIGSTOP 信号,以便暂停 安装。

kill -STOP installationPIDs

一旦准备好恢复它,您可以发送 SIGCONT 信号,然后就可以完成它。

kill -CONT installationPIDs

您应该很容易找到安装进程的 PID,例如您可以运行 htop 并在使用最多 CPU 的进程中查找。

如果您改变主意安装

即使您改变主意并且不想再安装该端口/软件包,我强烈建议您完成安装(按照下面的建议在需要时暂停)并卸载该端口/软件包然后。这听起来像是浪费时间,但却是最安全的做法。

Don't press Ctrl+C

Building on the answer by 4ae1e1, while (s)he interrupted the process sending a SIGKILL signal, I interrupted it sending an actual SIGINT signal, i.e. the usual Ctrl+C, and now no MacPorts app are working so far.

So I completely agree with 4ae1e1.

If you need your machine

If you need to suspend the installation, e.g. because you need your CPU to be available for other things, to send a SIGSTOP signal instead, in order to pause the installation.

kill -STOP installationPIDs

Once you are ready to resume it, you can send a SIGCONT signal and you can complete it.

kill -CONT installationPIDs

You should easily find the PIDs of the installation process, for example you can just run htop and look among the processes using most of the CPU.

If you change your mind about an installation

Even if you change your mind and you do not want that port/package installed anymore, I strongly recommend to just complete the installation (pausing it when needed as suggested below) and just uninstall the port/package afterwards. It sounds like a waste of time, but it is the safest thing to do.

爱你是孤单的心事 2025-01-13 01:40:58

我也想插话。我认为一个好的做法是在 Ctrl+C 之前查看安装的位置,然后清理您所依赖的依赖项并稍后重做主安装。例如,我正在安装 kdenlive,并在 virtuoso(众多依赖项之一)安装过程中终止了它。后来,我执行了 sudo port -v selfupdate,然后执行了 port clean virtuoso,然后使用 sudo port install kdenlive 再次启动了 kdenlive 安装。这似乎是一个不错的方法;它巡航通过第一部分,并在达到大师级时以正常速度加快。

I also would like to chime in. I think a good practice is to watch where you are in the installation before Ctrl+Cing, then clean the dependency you were on and redo the main install later. For example, I was installing kdenlive and killed it in the middle of the virtuoso (one of many dependencies) install. Later, I did a sudo port -v selfupdate, then a port clean virtuoso, then started the kdenlive install again with sudo port install kdenlive. This seems to be a decent way to go; it cruised through the first part and picked up at normal speed when it got to virtuoso.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文