2012-02-21 116 views
0

我为我的OS X Leopard(10.5.8)运行了MacPorts安装程序(2.0.3),它完成了“成功”。不幸的是,端口命令不可用,所以我查看了MacPorts Guide,它指出安装程序应该运行一个所谓的“postflight”脚本来设置必要的环境变量。我想手动运行该脚本飞行后(这是我从here下载),但执行失败,出现以下的输出:MacPorts安装 - shell命令/ Postflight脚本

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. 

任何想法?

回答

1

首先调用直接port命令:

$ /opt/local/bin/port help 

如果有合理的东西(比如帮助文本)回来那么它只是你的$PATH没有被使用当前的shell。尝试注销并重新打开,以解决在短期内(这将考验你的.bashrc文件被正确配置),或者你可以只直接修改PATH环境变量(不考.bashrc):

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

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

那些缺少Tcl脚本用于从较旧的安装升级,日志说PATH已被正确配置,但macports bin目录可能在PATH变量中有错误的位置,例如PATH结束。

如果你正在做一个新的安装你可以只需要PATH和MANPATH - 你想之前系统的全1按[1]

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

通过提供MacPorts的手册页