Running dpkg as ordinary user - why would you?
This for me is just about historical working style.
Sometimes I will be doing preparatory work for system changes as a regular user, and just paste my final command into a root terminal
It should not be too hard to leave this behind, but I document it here for posterity and to aid questions by other Debian users.
The complaint above appears because executables such as /sbin/ldconfig are (on some systems) not in the path of a regular user.
Some folks think it right that /sbin/ is not in the path of regular users.
In contrast a super user (root) might have a path that looks like:
Adjusting your way of working (or not) - the options:
So you can just avoid trying to use dpkg as ordinary user, or choose one of the options below:
- Setup sudo to allow a particular (non root) user to run dpkg
- Setup sudo to allow a particular (non root) user to run dpkg (passwordless)
- Alter $PATH to include /sbin and /usr/sbin
If you are leaning towards (2), then perhaps a better way is to run 'sudo bash' or similar as a way of switching into a way of adding / removing packages.
Note: You might want to think carefully before making sudo calls passwordless
A good book on Unix / Linux security will cover things like $PATH settings and sudo.
If you are tempted to ignore my warning about security risks of (2) or (3), then you might want to browse such a book.