command couldn't be located

Asked by ranjith

after entering sudo command ,and entering password, some error message appears,
this error occurs after i installed netkit application,pls help me in fixing this..
***this is the screenshot of the error that occured:
happy1@happy1-desktop:~$ sudo -i
[sudo] password for happy1:
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 'mesg' is available in '/usr/bin/mesg'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
-bash: mesg: command not found

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
ranjith
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

from a bad translation it sounds like the pdf is password protected. Is this correct?

Revision history for this message
ranjith (ranjith-sss2004) said :
#2

thank u for ur reply,
**i'll first type sudo -i in terminal, then it asks for password and then i'll give wvdial to connect to internet , it will connect normally
    but after installing netkit
**i used to do the same above mentioned but the message appears as

happy1@happy1-desktop:~$ sudo -i
[sudo] password for happy1:
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 'mesg' is available in '/usr/bin/mesg'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
-bash: mesg: command not found
root@happy1-desktop:~# wvdial
Command 'wvdial' is available in '/usr/bin/wvdial'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
-bash: wvdial: command not found

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

wow thats really not good at all.

run this command:

gksudo /etc/environment

and make sure the line shows this:

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

I recommend you look for /usr/bin in yours. It will most likely not be there so you will need to add it.

Revision history for this message
ranjith (ranjith-sss2004) said :
#4

/usr/bin is there and the above mentioned line is exactly present in /etc/environment
what to do?
this is what my /etc/environment looks like:
 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

try this:

gksudo gedit /root/.bashrc

Scroll to the bottom and add:

PATH=$PATH:/usr/bin

Save the new file. And close the terminal. Launch another and do what you need to do.

Instead of sudo -i, you can just add sudo to the start of each command.

Revision history for this message
ranjith (ranjith-sss2004) said :
#6

while opening one teminal and entering sudo to the start of command, it asks for password,( i didn't enter the password) but while opening another terminal at same time and entering sudo to the start of command , it doesn't ask for password ,it is directly entering to root

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

if you use sudo -i you are effectively root but you are still yourself.

Sounds like you need to add the /usr/bin to the path in /root, when you sudo -i you are still your user but home transfers to /root.

Revision history for this message
ranjith (ranjith-sss2004) said :
#8

thank u actionparsnip, thanks a lot for ur great effort in helping me.