-   Slackware (
-   -   sudo slackpkg = command not found (

gabrielmagno 03-01-2010 06:36 PM

sudo slackpkg = command not found
I edited my "sudoers" file with "visudo".
Added the line, after the root privileges definition.


root    ALL=(ALL) ALL
myuser  ALL=(ALL) ALL

I try to:

$ sudo ls /root
Blah  Blahblah  file.txt


But then I try to:

$ sudo slackpkg
sudo: slackpkg: command not found

With direct root acces it's ok:

$ sudo su
# slackpkg
executes normally

What may be wrong?

koenigdavidmj 03-01-2010 06:38 PM

You should have /sbin and /usr/sbin in your normal user path if you want to use sudo. Otherwise a lot of packaging utilities will break.

hedron 03-01-2010 06:39 PM

Try typing the full path to slackpkg? e.g.: sudo /sbin/slackpkg

gabrielmagno 03-01-2010 07:30 PM

$ sudo /usr/sbin/slackpkg

What is the most simple way to permanently add "/usr/sbin" to the $PATH variable?

mRgOBLIN 03-01-2010 07:48 PM

add PATH="$PATH:/usr/sbin" to one of your startup files

~/.profile or ~/.bash_login perhaps

dive 03-02-2010 12:17 AM

Why don't you just login with 'su -' ? That will give you a proper root login shell with paths etc.

info.latawaz 06-21-2013 02:09 AM

I didn't know that sudo needs to be installed. But I followed the link and did what was asked. Finally got this message.


root@localhost:~# slackpkg install sudo

Looking for sudo in package list. Please wait... DONE

No packages match the pattern for install. Try:

/usr/sbin/slackpkg reinstall|upgrade
After this, I added path /sbin to $PATH with this

export PATH=$PATH:/sbin
echo $PATH
So it seems PATH /sbin has been added. Before that I had added below line to /etc/sudoer

myuser localhost=/sbin/halt;/sbin/poweroff;/sbin/shutdown
After this, as myuser, I am doing this

sudo poweroff
Sorry, user myuser is not allowed to execute '/sbin/poweroff' as root on localhost.
What am I missing?

NonNonBa 06-21-2013 03:47 AM


I think you need commas as command separator, not semi-colons. :)

info.latawaz 06-21-2013 04:01 AM

Oops! Sorry Gabriel. I didn't realize that I was posting this in your thread. Sorry for that. I stumbled upon your thread because I think we two are trying to do the same thing. Hope my post comes in handy.

Thanks NonNonBa, will do what you are suggesting.

info.latawaz 06-22-2013 03:23 AM

Have a look at this post.
Should help.

Conrad_Troutman 06-22-2013 06:41 AM

I had the same problem. I fixed it by adding the following line to sudoers:

Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

All times are GMT -5. The time now is 11:15 AM.