• Register
1 vote
377 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 2 views
2 views
Problem: the command could not be located because "/bin" is not included in the path environment variable.
asked 6 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 94 views
94 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
0 votes
0 answers 1 view
1 view
Problem : Error : xdg_runtime_dir not set in the environment
asked 1 day ago Shovo210 3.1k points
0 votes
1 answer 2.2K views
2.2K 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 17 views
17 views
Problem: I've followed step by step the official Getting Started. I started from a clean linux install and installed everything required as per the "Building Projects with Native Code" tab. I have also read the troubleshooting section. I've already created the project using the terminal. This is the error when I run react-native run-android:
asked Feb 15 Ali 5.1k points
0 votes
1 answer 96 views
96 views
How would I refresh this project after modifying the React JavaScript code in the parent folder?
asked Dec 27, 2020 TeamScript 13.5k points
0 votes
1 answer 12 views
1 vote
1 answer 279 views
279 views
Problem : I am getting bellow flask app error error: could not locate flask application. you did not provide the flask_app environment variable.
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 37 views
37 views
Problem running homebrew as root is extremely dangerous and no longer supported.
asked Feb 9 charles mathews 3.8k points