安装*后*更改 macports 安装目录

发布于 2024-12-04 03:51:50 字数 258 浏览 0 评论 0原文

我在一台计算机上安装了 macports,我希望将整个 /opt 树复制到另一台计算机。除了,在新计算机上(都是带有 Lion 的 Intel Mac,所以我希望避免重新编译所有软件包)我有一个额外的硬盘,所以我想在 /Volumes/extradrive/opt 上安装 macports

我可以复制 macports从旧计算机转移到新计算机,然后在某处更改目录路径?我猜不会,因为所有软件都已编译为 /opt。如果是这样,我可以轻松地在新计算机上重新创建整个 macports 吗?

I have macports installed on one computer, and I was hoping to just copy the entire /opt tree to another computer. Except, on the new computer (both are Intel Macs with Lion, so I am hoping to avoid recompiling all the packages) I have an extra hard disk, so I want to install macports on /Volumes/extradrive/opt

Can I copy the macports tree over from the old computer to the new computer and then change the directory path somewhere? I am guessing not, because all the software has been compiled expecting /opt. If so, can I recreate the entire macports on the new computer easily?

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

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

发布评论

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

评论(1

醉梦枕江山 2024-12-11 03:51:50

是的,可以在两台计算机上维护一个 MacPorts /opt 目录,并在 /opt 之外进行一次安装,前提是它们都运行相同版本的 OSX 并且代码。我在自己的机器上执行相同任务的快速而肮脏的方法是:

rsync -arvz $macports_host_machine:/opt/ /Volumes/extradrive/opt/

其中 $macports_host_machine 是安装 MacPorts 的机器(在 /opt/ 中)。现在,将 /Volumes/extradrive/opt 链接到 /opt

sudo ln -s /Volumes/extradrive/opt/ /opt/

我还执行此附加步骤

sudo chown -h username:group /opt
sudo chmod -h 755 /opt

来更改符号链接的所有权和权限。

之后,我仅在 $macports_host_machine 上维护 /opt 目录,并定期与所有其他计算机(运行相同版本的 OSX 和 XCode)进行 rsync。

前面的说明是假设 MacPorts 安装在 $macports_host_machine 上的 /opt 中,如果 MacPorts 安装在其他非标准位置,则应替换 / opt$macports_host_machine 上的安装路径无关

Yes, it is possible to maintain a single MacPorts /opt directory on two machines and have one installation outside of /opt, if they are both running the same version of OSX and XCode. The quick and dirty way that I do the same task on my own machines is:

rsync -arvz $macports_host_machine:/opt/ /Volumes/extradrive/opt/

where $macports_host_machine is the machine on which MacPorts is installed (in /opt/). Now, link /Volumes/extradrive/opt to /opt:

sudo ln -s /Volumes/extradrive/opt/ /opt/

I also perform this additional step

sudo chown -h username:group /opt
sudo chmod -h 755 /opt

to change ownership and permissions of the symbolic link.

After that, I maintain the /opt directory on only $macports_host_machine and rsync with all of my other machines (running the same version of OSX and XCode) periodically.

The previous instructions were written assuming that MacPorts was installed in /opt on $macports_host_machine, if MacPorts was installed in some other non-standard location, you should replace /opt with whatever the installation path is on $macports_host_machine

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