• Register
1 vote
453 views

Problem :

I am facing following sudo path error
the command could not be located because '/bin' is not included in the path environment variable.
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Your PATH variable seems to be messed up. If you are trying to run a restricted user with rbash, you should have /usr/bin in $PATH. 

For a terminal session you can fix this by running following command:

export PATH=$PATH:/usr/bin

After that you can use sudo command, so you can edit /etc/environment file to make the change permanent, so, run in terminal:

sudo nano /etc/environment

To edit the file please make sure that the path is something like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

Save and close the file with Ctrl+X and press Y when you are asked.

9 7 4
38,600 points

Related questions

0 votes
1 answer 10 views
10 views
Problem: the command could not be located because "/bin" is not included in the path environment variable.
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 118 views
118 views
Problem : I am new to Chown. I am still learning it. I tried to set the EACCESS for the npm and then I ran the Chown command in the terminal to change the owner permission but currently i am totally stuck in following "Sudo : /usr/bin/sudo must be owned by uid 0 and have the setuid bit set" I am using ubuntu14.04 LTS. How to fix this error?
asked Feb 27, 2020 mphil 2.3k points
1 vote
1 answer 40 views
40 views
Problem : Error : xdg_runtime_dir not set in the environment
asked Feb 28 Sabbir Hossain 14.6k points
0 votes
1 answer 33 views
33 views
Problem: In my application directory (on Windows). I got this error: Sudo is not recognized as an internal or external command What could be the problem?
asked Mar 22 ummesalma 29.2k points
0 votes
1 answer 2.5K views
2.5K views
Problem : I am stuck with the following strange looking error 'sudo' is not recognized as an internal or external command, operable program or batch file.
asked Nov 16, 2019 peterlaw 6.9k points
0 votes
1 answer 3 views
3 views
Problem: I'm trying to install GitLab Runner on Mac with manual installation, but after entering the first command: sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64 I get the following error: User is not in the sudoers file. This incident will be reported.
asked 1 day ago anika11 32k points
0 votes
1 answer 2 views
2 views
Problem: Is there anyone to helo on > 'user is not in the sudoers file centos' ?
asked Mar 17 sadi1982 36.3k points
0 votes
1 answer 37 views
37 views
Problem: When I try to start postgresql I get an error: postgres postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. So then I try to set my ... properly start the server. I googled around for that error message but cannot find a solution. Can anyone provide some insight into this?
asked Apr 23 munim01 21k points
0 votes
1 answer 15 views
15 views
Problem: Does any body know the procedure to fix this? Running homebrew as root is extremely dangerous.
asked Mar 22 PkGuy 23.5k points
0 votes
1 answer 185 views
185 views
Problem running homebrew as root is extremely dangerous and no longer supported.
asked Feb 9 charles mathews 5.5k points