LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-01-2010, 05:36 PM   #1
gabrielmagno
Member
 
Registered: May 2009
Location: Belo Horizonte, Brasil
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
sudo slackpkg = command not found


I edited my "sudoers" file with "visudo".
Added the line, after the root privileges definition.

Code:
root     ALL=(ALL) ALL
myuser   ALL=(ALL) ALL
I try to:
Code:
$ sudo ls /root
Blah  Blahblah  file.txt
Ok.

But then I try to:
Code:
$ sudo slackpkg
sudo: slackpkg: command not found
With direct root acces it's ok:
Code:
$ sudo su
# slackpkg
....
....
executes normally
....
....
What may be wrong?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-01-2010, 05:38 PM   #2
koenigdavidmj
Member
 
Registered: Oct 2009
Posts: 73

Rep: Reputation: 25
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.
 
Old 03-01-2010, 05:39 PM   #3
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Rep: Reputation: 32
Try typing the full path to slackpkg? e.g.: sudo /sbin/slackpkg
 
Old 03-01-2010, 06:30 PM   #4
gabrielmagno
Member
 
Registered: May 2009
Location: Belo Horizonte, Brasil
Distribution: Slackware
Posts: 40

Original Poster
Rep: Reputation: 15
$ sudo /usr/sbin/slackpkg
works

What is the most simple way to permanently add "/usr/sbin" to the $PATH variable?
 
Old 03-01-2010, 06:48 PM   #5
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

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

~/.profile or ~/.bash_login perhaps
 
Old 03-01-2010, 11:17 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Why don't you just login with 'su -' ? That will give you a proper root login shell with paths etc.
 
Old 06-21-2013, 01:09 AM   #7
info.latawaz
Member
 
Registered: Jun 2013
Location: India
Posts: 44

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

Quote:
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
Quote:
export PATH=$PATH:/sbin
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/share/texmf/bin:.:/sbin
So it seems PATH /sbin has been added. Before that I had added below line to /etc/sudoer
Quote:
myuser localhost=/sbin/halt;/sbin/poweroff;/sbin/shutdown
After this, as myuser, I am doing this
Quote:
sudo poweroff
Password:
Sorry, user myuser is not allowed to execute '/sbin/poweroff' as root on localhost.
What am I missing?

Last edited by info.latawaz; 06-21-2013 at 03:03 AM.
 
Old 06-21-2013, 02:47 AM   #8
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 192

Rep: Reputation: Disabled
Hi,

I think you need commas as command separator, not semi-colons.
 
Old 06-21-2013, 03:01 AM   #9
info.latawaz
Member
 
Registered: Jun 2013
Location: India
Posts: 44

Rep: Reputation: Disabled
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.

Last edited by info.latawaz; 06-21-2013 at 03:03 AM.
 
Old 06-22-2013, 02:23 AM   #10
info.latawaz
Member
 
Registered: Jun 2013
Location: India
Posts: 44

Rep: Reputation: Disabled
Have a look at this post.
http://www.linuxquestions.org/questi...776/page2.html
Should help.
 
Old 06-22-2013, 05:41 AM   #11
Conrad_Troutman
LQ Newbie
 
Registered: Mar 2013
Location: Sweden
Distribution: Slackware
Posts: 12

Rep: Reputation: Disabled
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"
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why sudo root command not found? vitalstrike82 SUSE / openSUSE 5 11-07-2007 08:29 PM
sudo: shutdown: command not found ekdya Fedora 2 09-29-2006 04:42 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
sudo command not working startproc cmd not found Imajica21 Linux - General 2 04-14-2005 01:22 PM
sudo: readme : command not found vishal.thorat Linux - Security 3 07-17-2003 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration