You are not logged in.

#1 2011-09-09 18:42:28

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Command not found.

Hi,

Any command i run, it results in either sudo: command not found or bash: command not found. It works if i run for example /sbin/modprobe. How do i set correct path?

Thanks,
Donnie.

Offline

#2 2011-09-09 18:51:05

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Command not found.

Post here the output of

$ echo $PATH

and your ~/.bashrc file if any. You can set the PATH like so in ~/.bashrc - add:

PATH=$PATH:/your/new/path

. Can you not run commands as root ?

Last edited by roygbiv (2011-09-09 18:54:19)

Offline

#3 2011-09-09 18:56:28

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: Command not found.

roygbiv wrote:

Post here the output of

$ echo $PATH

and your ~/.bashrc file if any. You can set the PATH like so in ~/.bashrc - add:

PATH=$PATH:/your/new/path

. Can you not run commands as root ?

Thanks for quick reply.

$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/bin:/usr/bin:/bin
.bashrc

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

EDIT:I can run commands as root. Sudo pacman -Syu will work but sudo modprobe will not work rather sudo /sbin/modprobe will do it.

Last edited by donniezazen (2011-09-09 18:58:01)

Offline

#4 2011-09-09 19:00:46

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Command not found.

Ok, add the following to ~/.bashrc:

PATH=$PATH:/sbin

and then you should be set. Same procedure for other directories with binaries you want to run without specifying the absolute path. Re-log in or source the file:

$ source ~/.bashrc

Last edited by roygbiv (2011-09-09 19:03:38)

Offline

#5 2011-09-09 19:05:58

mcmillan
Member
Registered: 2006-04-06
Posts: 737

Re: Command not found.

As roygbiv said you can add sbin to your path, though this should already be done in /etc/profile. I think I still have the default lines which are

# Set our default path                                                                                       
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"                                          
export PATH  

If that's the same there's probably something else going wrong

Offline

#6 2011-09-09 19:15:12

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: Command not found.

mcmillan wrote:

As roygbiv said you can add sbin to your path, though this should already be done in /etc/profile. I think I still have the default lines which are

# Set our default path                                                                                       
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"                                          
export PATH  

If that's the same there's probably something else going wrong

I have this in /etc/profile. Their might be something wrong. I am new to Arch Linux and messing up with it.

Thanks for the solution guys.

Offline

#7 2011-09-09 19:17:15

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Command not found.

In my view it seems that a certain lightdm is messing up your PATH. Good luck!

Offline

#8 2011-09-09 19:41:54

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: Command not found.

It works for now. Thanks.

Offline

#9 2011-09-10 07:45:24

Wey
Member
Registered: 2011-04-22
Posts: 217

Re: Command not found.

Someone else had the same issue some time ago. For my understanding, you have to create a session wrapper for lightdm, that sources your /etc/profile. Have a look at https://bbs.archlinux.org/viewtopic.php … 45#p982145.

Offline

#10 2011-09-20 19:33:29

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: Command not found.

Wey wrote:

Someone else had the same issue some time ago. For my understanding, you have to create a session wrapper for lightdm, that sources your /etc/profile. Have a look at https://bbs.archlinux.org/viewtopic.php … 45#p982145.

It probably happens due to lightdm. I did a new system install and after lightdm install it ended up with same problem.

Offline

Board footer

Powered by FluxBB