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:
. Code:
root@debian:~# export PATH=$PATH:/usr/local/sbin/ I checked the file /root/.profile which contains the following : Code:
# ~/.profile: executed by Bourne-compatible login shells. |
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:
# |
Mmm.... login.defs looks good actually :(
|
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. |
Quote:
Code:
root@debian:~# echo $PATH |
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" Code:
if [ -f ~/.profile ]; then |
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 |
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. :(
|
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 One question though : Do I put the path with [/ {slash}] at the end or without ? |
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 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? |
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/ |
All times are GMT -5. The time now is 12:05 AM. |