When running command in shell (e.g. sudo apt-get install aptitude) this is the output:
dpkg: warning: 'ldconfig' not found in PATH or not executable.
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable.
dpkg: 2 expected program(s) not found in PATH or not executable.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
This are the variables I've set:
export PATH=$PATH:/usr/local/sbin:/usr/local/bin in bashrc
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" in /etc/environment
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" in /etc/sudoerds
echo $path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/node/node:/usr/local/sbin:/usr/local/bin
sudo echo $path
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/node/node:/usr/local/sbin:/usr/local/bin
Thanks, this worked for me!
nano /root/.bashrc
Go to the very last and enter:
export PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin
After updating the bashrc do:
. /root/.bashrc
OR source /root/.bashrc
Try sudo su -
and run the same command directly from the root and see if its goes through.
Also set the PATH variable in /root/.bashrc file to be on safer side if it doesn't work.
/root/.bashrc
export PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
This is just environment variable issue unless those binary's are actually missing which is unlikely, you never know others environment :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With