![]() |
sudo: command not found
I just set up my wife's computer (PB G4 12" running 10.3.2). She switched from Windoze, so I'm very anxious for everything to work. There's one hitch that I can't figure out: running ANY command in Terminal with sudo will produce a "command not found" error. All commands will work as expected when I give the full path, and all commands work when logged in as a normal user. Must be an environment thing, I suppose, but where do I set it? I'm not aware of having done anything differently from my G5 where this work normally. Pleaze help, this is about peace in our marriage...
|
Which shell: bash or tcsh? Sounds like your paths are misconfigured.
|
zsh, in fact. But even if I switch to bash, I get the same result. But that's my problem: how can paths be different when I do "sudo something" instead of "something"?
|
Maybe it is the 'sudo' command that is not being found?
What do you get from the command: which sudo (It should give: /usr/bin/sudo) Show us the results of the following command: echo $PATH |
No, sudo is found (since, e.g., sudo /usr/local/bin/rsync works, while sudo rsync doesn't). Here's the output:
Code:
% which sudo |
I think that's why.. your fink directories are first.. They should be last. Something along the lines of:
Code:
yellow% echo $PATH |
zsh seems to have the 'rehash' builtin command, so maybe you need to use it - did you add the rsync command to the /usr/local/bin directory after you started the shell?
And you started off by saying that you had a problem with "ANY" command - is that true or is it only certain commands? E.g. can you do: sudo ls ? |
Quote:
Code:
[pm @ Sao: ~] % echo $PATH |
Nope, I tried appending the paths, that doesn't change the behavior:
Code:
% echo $PATH |
Sorry, yellow, missed your last post (and thanks, btw, i appreciate your efforts). Yes, NO command works with sudo, not even ls or anything.
|
tas,
In my ~/.zshrc I have: Code:
# |
Sorry, yellow, missed your last post (and thanks, btw, i appreciate your efforts). Yes, NO command works with sudo, not even ls or anything.
Edit: Arrgh, that was hayne's post. Excuse me, but I'm grateful to both of you. |
What is the result of
Code:
sudo /usr/bin/env |grep PATH |
Code:
% sudo /usr/bin/env | grep PATHCode:
% sudo ls |
Is SECURE_PATH set in your environment?
|
I don't think so, echo $SECURE_PATH returns a blank line.
|
It was a shot in the dark, based on the manpage text
Code:
PATH Set to a sane value if SECURE_PATH is setCode:
root ALL=(ALL) ALL |
Please show us the lines in your "dot" files that set up the PATH.
|
No, nothing in /etc/sudoers besides the standard lines. As for my dot-files: I have .zprofile, which contains
Code:
source /sw/bin/init.shCode:
typeset -U path |
One possibility is that the permissions on the standard directories are screwed up.
What do you get from: ls -ld /bin (It should be something like: drwxr-xr-x 35 root wheel 1190 15 Nov 01:21 /bin ) And what do you get from: id (It should show that user as belonging to the group 'admin' among others) |
tas,
--Did you by chance deselect the "BSD Subsystem" item of the custom install screen when installing OS X? --It could also be permission problems or your shell startup scripts are not configured correctly. Please, what gives: echo $SHELL echo $0 PS: If you missed installing the BSD Subsystem, just insert your Panther CD and find the Welcome to Mac OS X/Optional Installs/BSD Subsystem file and double-click it. |
Hayne: here's what I get:
Code:
% ls -ld /binSao: if I had forgotten to install the BSD subsystem, the commands wouldn't work at all. Everything works fine, except under sudo. Code:
% echo $SHELL |
I'm running out of ideas.
I would suggest re-installing 'sudo' and associated files by using the third-party "Pacifist" utility to extract them from the Install CD. The only other idea I have is to try making a fresh new user account, leaving this account with the default shell (bash), make this account be an administrator as well, then see if sudo works with this new account. |
Possibly mine is a hold-over from Jaguar?
Code:
yellow% id |
Hayne, I thought of something similar. i just copied over the version of "sudo" from my G5 (where it works) to the Powerbook, but nada. Do you have any idea what the "associated files" would be?
|
tas: The only associated file I know of is the sudoers file. But do try creating a new user as I suggested above - that is more likely to lead us to a solution.
yellow: Yes, I think your user account is the same as it was under Jaguar since you kept your users when you installed Panther. If you do a fresh install or if you create a new user, it will get the new Panther features. |
Code:
[pm @ Sao: ~] % grepbom sudo |
OK, problem solved. And thanks to everybody, you were amazingly helpful!! Hayne, you were right, I should have done that right away. I created a new user, and lo and behold: sudo worked. I then moved all my .z-files to another directory and copied them back in one by one. The offending party was .zshenv. I had copied it over from my own computer and forgotten that it contained a reference to the teTeX manpath that isn't installed on my wife's computer. Apparently, zsh choked on it to such an extent that sudo wouldn't work. As soon as I deleted the line about manpath, it worked normally. Why a reference to manpath shoud affect sudo (and apparently nothing else) is beyond me; I'll put this down under "UNIX voodoo." Best part: I could do most of it remotely, so my wife hasn't realized, and now she has a Mac that'll hopefully work flawlessly. Phew...
|
| All times are GMT -5. The time now is 05:48 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.