LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-06-2018, 01:42 PM   #1
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,248

Rep: Reputation: 79
ldconfig and start-stop-daemon not found error in Debian Buster/testing


I have been using "su" to switch to root mode for doing system updates for Buster. Recently, dpkg failed with the error that ldconfig and start-stop-daemon were not found. It is because /sbin was no longer found in the user's PATH. I fixed this by editing /etc/profile.

The original /etc/profile looks like this:

Code:
if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
I changed mine to this:

Code:
if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin"
fi
export PATH
Note the bold fonts were the added text. I think this error can be avoided by "su -" instead of just "su". Debian decided to change the way PATH was reset to discourage using su. I just wanted to post the solution here in case anyone else runs into the same problem. I know su gives me the power to do bad things, but I've been in the habit of using "su" for 15 years. Call me a curmudgeon if you want.
 
Old 08-07-2018, 11:26 AM   #2
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,248

Original Poster
Rep: Reputation: 79
The problem returns after logging out and back in. The same change needs to be made for the user path environment in /etc/login.defs. The line:

Code:
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
should be changed to:

Code:
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin
 
Old 08-07-2018, 07:54 PM   #3
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,248

Original Poster
Rep: Reputation: 79
...and you must add this line to /etc/login.defs

Code:
ALWAYS_SET_PATH yes
Now it is giving me the old behavior again.
 
Old 08-23-2018, 06:29 AM   #4
J_Steve
LQ Newbie
 
Registered: Aug 2018
Posts: 3

Rep: Reputation: Disabled
Hi,

I've very recently had a very similar problem to what you describe in this thread using Debian testing. It was as if the entry for ENV_SUPATH in /etc/login.defs was missing but that looks good and that file has not been modified recently.

I added a "PATH=/sbin" etc to /etc/environment and AFAIK this has fixed the problem although I consider it a workaround.

I've been trying to figure out what I may have done to cause this and then came across this thread. I also use su.

I thought it may have been caused by a "pkill pd" line in a script I was running killing something else. A reboot didn't fix it.

Could you elaborate about using "su -" instead of "su" and the changes in Debian you mentioned please?

Steve
 
Old 09-13-2018, 01:15 PM   #5
guikubivan
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
I got freaked that suddenly `su root` gave me a bunch of missing commands. However, just using `su -` fixed everything I believe. See here more info: https://superuser.com/questions/4539...without-hyphen
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Debian installer weekly build iso testing buster corrupt libdevmapper AwesomeMachine Debian 2 03-02-2018 07:54 PM
start-stop-daemon command not found in slackware c_porter84 Linux - Networking 1 02-01-2012 08:48 PM
Using debian start-stop-daemon on Centos powadha Linux - Software 1 11-02-2008 06:59 AM
Unexpected error messages with start-stop-daemon markseger Debian 3 10-29-2008 09:14 PM
start-stop-daemon: user `man' not found cccc Debian 4 03-06-2007 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration