当我在终端上执行命令时:
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
我添加了以下文件: .bashrc , etc / enviroment , .profile 和 .bash_profile 行:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
错误仍然存在。
当我运行命令 echo $ PATH 时,仅显示:
/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java:/usr/bin
我在 .bashrc 中找到了此Java PATH。
我能够通过输入以下命令来使用 SUDO 和其他命令:
export PATH=$PATH:/usr/bin
但这不是永久的。
答案 0 :(得分:0)
请注意,您的PATH条目中没有任何引号。另外,您还需要最后导出路径。 将其写在.bashrc的末尾,并删除/ etc / environment中的条目和配置文件:
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export PATH
我希望这能帮到您。