LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   'sudo aptitude' problem (https://www.linuxquestions.org/questions/debian-26/sudo-aptitude-problem-905784/)

qrange 09-30-2011 10:39 AM

'sudo aptitude' problem
 
as of recent, if I try 'sudo aptitude', packages fail to install with following error:

Code:

Preconfiguring packages ...
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)
A package failed to install.  Trying to recover:
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.
Press return to continue.

if I use 'su' and then aptitude, there is no error. what could it be?

cynwulf 09-30-2011 10:57 AM

Misconfigured sudo?

Try running something else with sudo and see if you get the same kind of PATH errors?

craigevil 09-30-2011 11:02 AM

Your sudo PATH is messed up.

Take a look at /etc/sudoers make sure you have these lines:

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

qrange 09-30-2011 03:15 PM

for some reason, the second line was missing. it works now.
thanks.


All times are GMT -5. The time now is 03:19 AM.