Debian This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-30-2005, 03:02 PM
|
#1
|
|
Member
Registered: Apr 2005
Posts: 93
Rep:
|
dpkg: `file' not found on PATH.
Hi,
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:
Code:
root@debian:~# export PATH=$PATH:/usr/local/sbin/
root@debian:~# export PATH=$PATH:/usr/sbin/
root@debian:~# export PATH=$PATH:/sbin
However, this is working only once.
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 ...
|
|
|
|
04-30-2005, 09:27 PM
|
#2
|
|
Senior Member
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597
Rep:
|
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
|
|
|
|
04-30-2005, 09:34 PM
|
#3
|
|
Member
Registered: Apr 2005
Posts: 93
Original Poster
Rep:
|
Mmm.... login.defs looks good actually 
|
|
|
|
04-30-2005, 10:43 PM
|
#4
|
|
Senior Member
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597
Rep:
|
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.
|
|
|
|
04-30-2005, 11:09 PM
|
#5
|
|
Member
Registered: Apr 2005
Posts: 93
Original Poster
Rep:
|
Quote:
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.
|
Ok, echo $PATH gives me
Code:
root@debian:~# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
Which means sbin is indeed missing. Where else can I set these ? It is correctly set in /etc/login.defs
|
|
|
|
04-30-2005, 11:51 PM
|
#6
|
|
Senior Member
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597
Rep:
|
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:
Code:
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin"
export PATH
Or, alternatively, you could try to make root user's .bashrc to read .profile (where /sbin apparently is mentioned) by adding this to root's .bashrc:
Code:
if [ -f ~/.profile ]; then
. ~/.profile
fi
Last edited by Dead Parrot; 04-30-2005 at 11:57 PM.
|
|
|
|
05-01-2005, 12:00 AM
|
#7
|
|
Member
Registered: Apr 2005
Posts: 93
Original Poster
Rep:
|
I am using only Putty to connect to the server ..
I have tried both and still :
root@debian:~# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
|
|
|
|
05-01-2005, 01:05 AM
|
#8
|
|
Senior Member
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597
Rep:
|
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. 
|
|
|
|
05-01-2005, 01:47 AM
|
#9
|
|
Member
Registered: Apr 2005
Posts: 93
Original Poster
Rep:
|
Thanks a lot guys,
what I did now is :
/root/.bash_profile
export ISU_HOME="/var/www/isu"
export PATH=$PATH:/sbin/
export PATH=$PATH:/usr/sbin/
export PATH=$PATH:/usr/local/sbin/
export PATH=$PATH:/sbin
export PATH=$PATH:/usr/sbin
export PATH=$PATH:/usr/local/sbin
[/b]
And :
Code:
root@debian:~# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/sbin/:/usr/sbin/:/usr/local/sbin/:/sbin:/usr/sbin:/usr/local/sbin
One question though :
Do I put the path with [/ {slash}] at the end or without ?
|
|
|
|
05-01-2005, 07:08 AM
|
#10
|
|
Senior Member
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597
Rep:
|
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.
|
|
|
|
08-07-2008, 09:22 AM
|
#11
|
|
Member
Registered: Dec 2007
Posts: 32
Rep:
|
I know I'm late to the game, but I'm having a similar problem.
However, all my paths are correct, so I don't know what the issue is.
I think it's how dpkg was installed.
I'm using DSL-N, and got dpkg on the system with a myDSL extension that was written for DSL.
Any experience with this?
|
|
|
|
10-21-2011, 07:53 AM
|
#12
|
|
LQ Newbie
Registered: Oct 2011
Posts: 1
Rep: 
|
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:
Code:
export PATH=$PATH:/sbin:/usr/sbin/:/usr/local/sbin/
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:23 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|