MacPorts安装 - Shell命令/ Postflight脚本

时间:2012-02-21 19:27:25

标签: macos macports osx-leopard

我为我的OS X Leopard(10.5.8)运行了MacPorts安装程序(2.0.3),该程序已成功完成。不幸的是port命令不可用所以我查看了MacPorts Guide,它说安装程序应该运行一个所谓的“postflight”脚本来设置必要的环境变量。我试图手动运行postflight脚本(我从here下载),但执行失败,输出如下:

    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.

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

首先直接调用port命令:

$ /opt/local/bin/port help

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

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

答案 1 :(得分:0)

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

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

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

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