Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Nekochef opened this issue May 18, 2018 · 1 comment

Comments

@Nekochef
Copy link

Nekochef commented May 18, 2018

I haven't opened my WSL for a month, it worked properly last time, but when I opened it this time, every basic command cannot be executed:

shadowstep@Shadowstep:~$ echo $SHELL
/bin/bash
shadowstep@Shadowstep:~$ ll
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
shadowstep@Shadowstep:~$ bash
Command 'bash' is available in '/bin/bash'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: command not found
shadowstep@Shadowstep:~$ /bin/bash
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
shadowstep@Shadowstep:~$ source ~/.profile
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
shadowstep@Shadowstep:~$

if I manually enter:
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:
Then those commands are fixed. However my pre-defined environment variables exist in ~/.bashrc still cannot be executed.
if I execute echo $PATH at the startup, the paths are:
/home/shadowstep/bin:/home/shadowstep/.local/bin:/home/shadowstep/UNIX/Package/modeltestng,
which is equivalent to executing source ~/.profile plus the last line of ~/.bashrc, but my .bashrc file has four lines at last:

export PATH="/home/shadowstep/miniconda3/bin:$PATH"
export PATH=~/src/edirect:$PATH
export DISPLAY=:0
export PATH="/home/shadowstep/UNIX/Package/modeltestng"

WSL just loaded .profile and the last line of .bashrc

Is it a bug? How should I fix it?

@therealkenc
Copy link
Collaborator

but my .bashrc file has four lines at last:
[...]
export PATH="/home/shadowstep/UNIX/Package/modeltestng"

That last line just blew away the proceeding export PATH assignments. You want:

export PATH=/home/shadowstep/UNIX/Package/modeltestng:$PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants