Error message with ldconfig etc. coming up in Debian all the time

  • Thread starter Thread starter ntg
  • Start date Start date

ntg

ntg

Associate
Joined
24 Nov 2008
Posts
2,499
Whenever I try to purge an installed application, or when I try to install others (it's not specific to an app per se) I get the following error:
dpkg: warning: 'ldconfig' not found in PATH or not executable.
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable.
dpkg: error: 2 expected programs not found in PATH or not executable.
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)

I've tried updating the SIDs but not sure if I did it right, checked the usual google results but no joy.

Any ideas?

I'm a complete newbie by the way and I'm using a VPN that runs Debian.
 
As root what is you PATH set to be?

echo $PATH

It is:

/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin


One of the solutions I had found was suggesting the following:
The simple solution is to modify in /etc/sudoers
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Does that mean (I just realised it) I should replace the secure_path path with the /bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin instead?
 
No, don't do that as your removing the references to the very directories you want. Theoretically with that there access to the commands via sudo should gain that PATH and work.

I don't have a debian boxes here to look at but looking at a CentOS 5 box here in the lab root's PATH is set to be:

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

where the three sbin entries are added through /etc/profile for users with an effective UID of 0 (i.e. root). (Ignore that I don't have /usr/X11R6/bin in that PATH; I don't have X installed on that server).

With sudo it looks to be a bit more complex with it having the ability to over-ride some environment variables. I suggest you have a read about the sudo env_keep option

Thanks I'll look into that. I'll be changing to Ubuntu soon so I guess that may solve the problem anyway.
 
Back
Top Bottom