# The Ubuntu Forum Community > Ubuntu Official Flavours Support > Desktop Environments > [ubuntu] ...not included in the PATH environment variable

## tcn

Dear,

Today I installed a code for my simulation and something wrong happens. I can not log in normally anymore and I have to come to failsafe-session. 



```
/etc/gdm/Xsession: Beginning session setup...
/etc/profile: 33: source: not found
/etc/gdm/Xsession: 192: ls: not found
/etc/gdm/Xsession: Executing /usr/bin/gnome-session failed, will try to run x-terminal-emulatorexec: 205: x-terminal-emulator: not found
```


When I just go into failsafe-session, I got:



```
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: 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.
bash: dircolors: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: uname: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: uname: command not found
bash: [: !=: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: sed: command not found
```


In failsafe-session, I tried to look around but every times I give a command (even simple as ls-, sudo- ...) Ubuntu tells me that:



```
Command 'ls' is available in '/bin/ls'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.

Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
```

Could anyone please help me to solve this problem, I stuck there and can not do anything now ?

Thank you for your time,
Chi

----------


## Brandon Williams

What does your /etc/environment file look like? Mine looks like this:


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

If the content of the file looks OK, what about the premissions?:


```
$ ls -l /etc/environment
-rw-r--r-- 1 root root 79 2010-03-16 14:44 /etc/environment
```

Is yours readable by the group and the world?

----------


## tcn

Hi Brandon,

I can not give any command at all, every time I tried I got a message:



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

even with ls- or env.

How can I check my environment variable without using command ?

----------


## Brandon Williams

Just set the PATH variable on the command line:


```
export PATH=/usr/bin:/bin
```

----------


## tcn

Thanks Brandon for your help, the problem was solved with that command  line ^_^

 :Popcorn:

----------


## undercash

Hello

I have a very weird issue for 2 days

I setup the server 4 months ago and it never happened before.

I use to type : ffmpeg <file> to analyse the encoding of video file before sending to conversion

Since 2 days ago I get this 




> Command 'ffmpeg' is available in '/usr/local/bin/ffmpeg'
> The command could not be located because '/usr/local/bin' is not included in the PATH environment variable.
> -bash: ffmpeg: command not found


However in the /etc/environment file, I have 




> PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
> LANG="en_US.ISO-8859-15"
> LANGUAGE="en_US:en:en_GB:en"


so I assume this is ok. 

If I export the path using the previous post command line, then the echo $PATH is good again, but only for some time , like some hours, then it goes back to 




> root@server:~# echo $PATH
> /usr/bin:/bin:/usr/sbin:/sbin


As you can see I am logging using the root account. I have no idea why this now happens, I didn't install anything lately

----------


## tikamchandrakar@gmail.com

When i start the terminal it always so the message, like this and please tell me the what is the default bashrc

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 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
uname: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
uname: command not found
bash: [: !=: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
Command 'sort' is available in '/usr/bin/sort'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
sort: command not found
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
bash: /home/tikam/TikamChandrakar/Androide/android-sdk-linux_x86: No such file or directory
tikam@tikam-desktop:~$ vi ./bashrc
Command 'vi' is available in '/usr/bin/vi'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
vi: command not found
tikam@tikam-desktop:~$ export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/bin

----------


## quequotion

> When i start the terminal it always so the message, like this and please tell me the what is the default bashrc


I'm having a similar problem. Tried to set a different path with ~/.bashrc, ~/.profile, /etc/profile, /etc/environment, /etc/login.defs, crontab, pam.d etc etc etc.

Nothing will give me a permanent, system-wide, PATH.

The files in ~/ only affect gnome-terminal.

Everything else is ignored or overridden somewhere.

I can't run applications from shortcuts or the terminal if their executable is outside of /usr/local/bin:/usr/bin:/bin

----------


## pranshu24

> Just set the PATH variable on the command line:
> 
> 
> ```
> export PATH=/usr/bin:/bin
> ```




Thanks a lot Brandon....really seemed to b in trouble  :Smile:

----------


## agathery

> I'm having a similar problem. Tried to set a different path with ~/.bashrc, ~/.profile, /etc/profile, /etc/environment, /etc/login.defs, crontab, pam.d etc etc etc.
> 
> Nothing will give me a permanent, system-wide, PATH.
> 
> The files in ~/ only affect gnome-terminal.
> 
> Everything else is ignored or overridden somewhere.
> 
> I can't run applications from shortcuts or the terminal if their executable is outside of /usr/local/bin:/usr/bin:/bin


I know this is old issue but I face with same problem and google brought me here. After a few try I solved my problem by adding this line



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

to the top of 

```
/etc/bash_completion
```

 I hope this helps you too.

----------


## oldos2er

Closed, necromancy.

----------

