600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > The command could not be located because '/sbin' is not included in the PATH environment variable.

The command could not be located because '/sbin' is not included in the PATH environment variable.

时间:2021-10-05 11:56:08

相关推荐

The command could not be located because '/sbin' is not included in the PATH environment variable.

问题来源

重启Ubuntu后习惯性的执行ifconfig

报错如下

Command 'ifconfig' is available in '/sbin/ifconfig'The command could not be located because '/sbin' is not included in the PATH environment variable.This is most likely caused by the lack of administrative privileges associated with your user account.ifconfig: command not found

分析原因

应该是/sbin这个文件夹莫名其妙的从环境变量里消失了

解决方式

所以我们可以先查查看我们的环境变量:

a@ubuntu ~> echo $PATH/home/a/.local/bin /usr/local/bin /usr/bin /bin /usr/games /snap/bin

居然不见「/sbin」,

所以我们得将「/sbin」加入至环境变数之中:

a@ubuntu ~> export PATH=$PATH:/sbin

再次查看环境变量:

a@ubuntu ~> echo $PATH/snap/bin /sbin

这么一来以后就可以使用 /sbin 目录下的指令了

问题

为什么我把/sbin加入环境变量后

再次输出环境变量 环境变量就变少了呢?

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。