2012-02-21 128 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的手冊頁