DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am quite new in Debian and a "professional" friend tried to help me with something. The result : A messed up system.
When installing packages with apt-get I get the following errors :
Code:
.
.
Fetched 619kB in 1s (354kB/s)
.
.
Preconfiguring packages ...
dpkg: `ldconfig' not found on PATH.
dpkg: `start-stop-daemon' not found on PATH.
dpkg: `install-info' not found on PATH.
dpkg: `update-rc.d' not found on PATH.
dpkg: 4 expected program(s) not found on PATH.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)
When executing the following commands, I can install the programs with apt-get again:
I checked the file /root/.profile which contains the following :
Code:
# ~/.profile: executed by Bourne-compatible login shells.
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
export PATH
mesg n
It looks actually fine, doesn't it ? I am really lost, any help is highly appreciated ...
I haven't had any PATH related problems using Debian. Then again, I've never logged in as root -- I always login as normal user and then use "su" to become "superuser" that has root privileges.
If that doesn't help, you should perhaps check /etc/login.defs. In my login.defs there are these lines that appear to be important in defining PATH:
Code:
#
# *REQUIRED* The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
Maybe you should try "echo $PATH" both as normal user and as superuser to find out if the problem only exists when you "su" to root.
Also, ~/.bash_profile (or ~/.profile) defines only login shell while ~/.bashrc defines other (non-login) shells that you open afterwards. So, if the problem only appears in non-login shells (like in terminal window), then you could try to add PATH in ~/.bashrc to see if that helps.
Originally posted by Dead Parrot Maybe you should try "echo $PATH" both as normal user and as superuser to find out if the problem only exists when you "su" to root.
Also, ~/.bash_profile (or ~/.profile) defines only login shell while ~/.bashrc defines other (non-login) shells that you open afterwards. So, if the problem only appears in non-login shells (like in terminal window), then you could try to add PATH in ~/.bashrc to see if that helps.
This probably depends on your login method. If you use a "display manager" (kdm, gdm, wdm, or xdm), then it's possible that PATH is defined in the display manager's config file. I use wdm and PATH for both normal users and the superuser is defined in /etc/X11/wdm/wdm-config. (I think that for gdm the config file is /etc/gdm/gdm.conf but I don't know about the other display managers.) If you use the command line to login, then such files as /etc/login.defs, /etc/profile, and /etc/bash.bashrc should define system-wide login settings that can be changed with the login files (.profile, .bash_profile, and .bashrc) in user's home directory.
If your problem appears during X session (in terminal window) after starting the session with "startx", then adding /sbin to PATH in .bashrc may help. Make it something like this:
Hmm... I don't know the reason, but your problem seems to be that you're getting normal user's PATH while you're the root user. So maybe you should edit normal user's login files and make their PATH identical with root user's. In /etc/login.defs, you can change ENV_PATH to be identical with ENV_SUPATH. If you have made a normal user, you can also edit .bash_profile and .bashrc in the normal user's home directory to contain the same PATH that is set in root user's .profile. Then logout and login again to see if "echo $PATH" now has /sbin. If this still doesn't help, then I'm afraid that I'm running out of suggestions.
It's great that you found a working solution at last.
AFAIK, the slash at the end of the export command is not necessary -- it shouldn't have any effect on the actual command if you add the slash mark or if you leave it out.
I am fully aware that this is an old thread, but as this thread is the first hit I got while Googleing this issue, I will provide a sollution for users who have disabled login as root:
Add this line to your /home/[user]/.bashrc file:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.