Closed FedX-sudo closed 2 years ago
Probably got the issue
by default if no command is specified, distrobox
uses bash -l
so it logs in
On debian this will source /etc/profile
and this will override the PATH that we're passing in the podman env. (that is trying to pass your local PATH correctly)
The override is evidently because of the lines 4 to 9 in /etc/profile
in Debian:
4 if [ "$(id -u)" -eq 0 ]; then
5 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
6 else
7 PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
8 fi
9 export PATH
While on Fedora and in Arch Linux PATH is always treated in an additive way (PATH=$PATH:[...]
), and in Ubuntu it's set in /etc/environment
(which is not sourced in a shell login)
A solution could be either to open a bug in debian upstream, or to simply use
distrobox enter debian-testing -- bash
without the -l
Yeah, that fixed it. This is an interesting thing, and I did not think that would be the issue. I wonder why it changes it for being in logging mode vs normal mode...
Yeah, that fixed it. This is an interesting thing, and I did not think that would be the issue. I wonder why it changes it for being in logging mode vs normal mode...
Because the -l
triggers a login, which means it sources profile files ad explained here
https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
While without the -l
it just executes bash, no profile involved
Got it. That is super interesting. For now I am fine just executing it with -- bash, but I am not sure if opening an issue upstream would be more beneficial long term...
Got it. That is super interesting. For now I am fine just executing it with -- bash, but I am not sure if opening an issue upstream would be more beneficial long term...
Not really sure if it's in their scope or not
You can work around it either using -- bash
or specifying the PATH in ~/.bashrc or ~/.profile so that it's sourced anyway during login
Ok, yeah. Thank you so much for the help!
Closing the issue then :+1:
Describe the bug On some Debian based Distros, specifically Debian and Kali (but not Ubuntu?), paths not defined in the standard-paths variable are not moved over to the container.
To Reproduce
Expected behavior This is only noticed in some distros, specifically ones based on Debian, and as such, I was expecting to see paths such as
~/.local/bin
or~/.nix-profile/bin
in $PATH.Logs
distrobox-enter debian-unstable --verbose
distrobox-enter arch --verbose
**Desktop (please complete the following information)
Additional context Add any other context about the problem here.