sudo and slackpkg
I am a novice with linux. I am trying to figure out my way with maintaining packages. I know that generally, we should avoid using the su command and then running the other commands that need elevated privileges. Except when I try to run sudo, I seem to have a problem:
Code:
bash-4.2$ sudo slackpkg info seamonkey Code:
bash-4.2$ su |
It's because slackpkg is in /usr/sbin, which is not in your regular user's PATH. sudo will not modify your PATH or other environment variables, whereas su -l will give you essentially a true root shell.
|
Quote:
|
First, a hint: did you look at the /etc/sudoers file?
If you do, and search for the string 'path', you'll see a comment that explains exactly what you are asking. It's actually an option, so you can modify the behaviour there. Otherwise, you could do this, too: Code:
$ echo $PATH You can find out where `slackpkg` is located in the location that Slackware records anything that gets installed with `installpkg`: Code:
$ grep slackpkg /var/log/packages/slackpkg* Which brings us back to your question. And the answer, as I've said, is in /etc/sudoers. On line 59 or so: Code:
## Uncomment to use a hard-coded PATH instead of the user's to find commands Hope that helps. |
Thanks for the helpful replies, everyone.
|
Quote:
Have a look at sudo's introduction page for a more in-depth look at the program. https://www.sudo.ws/intro.html But, as others have pointed out, your problem is quickly solved with a modification to your /etc/sudoers file :) |
All times are GMT -5. The time now is 01:21 AM. |