简体   繁体   English

sudo:端口:更新.bash_profile后找不到命令

[英]sudo: port: command not found after updating .bash_profile

I am trying to install MacPorts on my OS 10.5.8. 我正在尝试在OS 10.5.8上安装MacPorts。 I followed the instructions for the installation of the MacPorts-2.1.3.tar.bz2 package, and after adding the following lines to my .bash_profile : 在将以下行添加到我的.bash_profile之后,我遵循了MacPorts-2.1.3.tar.bz2软件包安装说明。

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

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

I still got the following error when I tried to execute the the sudo port -v selfupdate command: 当我尝试执行sudo port -v selfupdate命令时,仍然出现以下错误:

sudo: port: command not found

After investigating a similar post about the same error, I still am confused. 在调查了关于相同错误的类似帖子之后,我仍然感到困惑。 Is it because I have my new path statements in the my .bash_profile and not in .profile or is it also because I forget the MANPATH environment variable? 是因为我在.bash_profile有新的路径语句,而不是在.profile中,还是因为我忘记了MANPATH环境变量?

Thanks for your help! 谢谢你的帮助!

You are missing a leading backslash: /opt/local - not opt/local 您缺少前导反斜杠: /opt/local不是opt/local

The automated annotations from a MacPorts install always prepended the following directories for me: export PATH=/opt/local/bin:/opt/local/sbin:$PATH , in .profile . MacPorts安装中的自动注释始终为我添加了以下目录: export PATH=/opt/local/bin:/opt/local/sbin:$PATH .profile export PATH=/opt/local/bin:/opt/local/sbin:$PATH

ie, the port binaries should take precedence over the system, or whatever else you have in your current PATH . 即,端口二进制文件应优先于系统或当前PATH具有的其他文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM