MacPorts 安装——Shell 命令/Postflight 脚本

发布于 2025-01-07 23:13:18 字数 1553 浏览 1 评论 0原文

我已经为我的 OS X Leopard (10.5.8) 运行了 MacPorts 安装程序 (2.0.3),它“成功”完成。不幸的是,端口命令不可用,所以我查看了 MacPorts 指南,其中说安装程序应该运行所谓的“postflight”脚本来设置必要的环境变量。我尝试手动运行 postflight 脚本(我从 此处下载< /a>),但执行失败并显示以下输出:

    Detected the bash shell.
    Your shell already has the right PATH environment variable for use with
    MacPorts!
    Your shell already has the right MANPATH environment variable for use with
    MacPorts!
    Your shell already has the right DISPLAY environment variable for use with
    MacPorts!
    Adding [default] tag to sources.conf if needed...
    couldn't read file "/Contents/Resources/upgrade_sources_conf_default.tcl": no
   such file or directory
    Updating port image format...
    couldn't read file "/Contents/Resources/images_to_archives.tcl": no such file or
    directory
    Synchronizing the MacPorts installation with the project's rsync server...
    -bash: __PREFIX__/bin/port: No such file or directory
    An attempt to synchronize your recent MacPorts installation with the project's
    rsync server failed!
    Please run 'sudo port -d selfupdate' manually to find out the cause of the 
    error.
    You have succesfully installed the MacPorts system, launch a terminal and try it
    out!
    Read the port(1) manual page and http://guide.macports.org for help,
    http://www.macports.org/contact.php if you need to get in touch with The 
    MacPorts Project.

有什么想法吗?

I had run the MacPorts installer (2.0.3) for my OS X Leopard (10.5.8) which finished "successfully". Unfortunately the port command was not available so I looked in the MacPorts Guide which says that the installer should have run a so-called "postflight" script that sets the necessary environment variables. I tried to run the postflight script manually (which I downloaded from here), but the execution fails with the following output:

    Detected the bash shell.
    Your shell already has the right PATH environment variable for use with
    MacPorts!
    Your shell already has the right MANPATH environment variable for use with
    MacPorts!
    Your shell already has the right DISPLAY environment variable for use with
    MacPorts!
    Adding [default] tag to sources.conf if needed...
    couldn't read file "/Contents/Resources/upgrade_sources_conf_default.tcl": no
   such file or directory
    Updating port image format...
    couldn't read file "/Contents/Resources/images_to_archives.tcl": no such file or
    directory
    Synchronizing the MacPorts installation with the project's rsync server...
    -bash: __PREFIX__/bin/port: No such file or directory
    An attempt to synchronize your recent MacPorts installation with the project's
    rsync server failed!
    Please run 'sudo port -d selfupdate' manually to find out the cause of the 
    error.
    You have succesfully installed the MacPorts system, launch a terminal and try it
    out!
    Read the port(1) manual page and http://guide.macports.org for help,
    http://www.macports.org/contact.php if you need to get in touch with The 
    MacPorts Project.

Any ideas?

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

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

发布评论

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

评论(2

围归者 2025-01-14 23:13:18

首先直接调用 port 命令:

$ /opt/local/bin/port help

如果该命令返回一些合理的内容(例如帮助文本),那么说明您当前的 shell 没有使用您的 $PATH 。尝试注销并重新登录以在短期内解决该问题(这将测试您的 .bashrc 文件是否已正确配置),或者您可以只修改 PATH 环境变量直接(不测试 .bashrc):

$ export PATH=$PATH:/opt/local/bin

First invoke the port command directly:

$ /opt/local/bin/port help

If that comes back with something reasonable (like the help text) then it's just that your $PATH isn't being used by your current shell. Try logging off and back on again to resolve that in the short term (this will test that your .bashrc file is correctly configured) or you could just modify the PATH environment variable directly (which doesn't test .bashrc):

$ export PATH=$PATH:/opt/local/bin
对你而言 2025-01-14 23:13:18

您下载了 postflight 脚本,但它无法单独访问 Contents/ 中的附件脚本,因为这些脚本位于安装包中。

那些丢失的 Tcl 脚本用于从较旧的安装进行升级,日志显示 PATH 已正确配置,但 macports bin 目录在 PATH 变量中的位置可能错误,例如位于 PATH 的末尾。

如果您正在进行全新安装,则只需 PATH 和 MANPATH - 您需要 macports 在系统提供的手册页之前提供手册页 - 根据 [1]

[1] http://guide.macports.org/#installing.shell.postflight

You downloaded the postflight script but it alone cannot access the accessory scripts in Contents/ because those are located into the install package.

Those missing Tcl scripts are for upgrading from an older install, the log says PATH was already correctly configured but the macports bin directory could have the wrong position in PATH variables, for instance being at the end of PATH.

If you are doing a fresh install you can just only need PATH and MANPATH -you want man pages provided by macports before system's ones- as per [1]

[1] http://guide.macports.org/#installing.shell.postflight

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