shell config /etc/profile does not set $PATH
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
base-files (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
lsb_release -rd
Description: Ubuntu 16.04.5 LTS
Release: 16.04
apt-cache policy base-files
base-files:
Installed: 9.4ubuntu4.7
grep -e PATH -e environment /usr/share/
0
expectation:
/etc/profile should source /etc/environment to set the $PATH variable
reality:
/etc/profile does not set $PATH
scenario:
when chroot-ing from arch linux into ubuntu linux,
and running 'source /etc/profile'
then $PATH does not contain /bin:/sbin:
which are needed to run 'apt-get update && apt-get upgrade'
... otherwise 'apt-get update' fails with
Unknown error executing apt-key
and 'apt-get upgrade' fails with
Processing triggers for cracklib-runtime (2.9.2-1ubuntu1) ...
/var/lib/
dpkg: error processing package cracklib-runtime (--unpack):
subprocess installed post-installation script returned error exit status 127
only after 'source /etc/environment' all runs fine.
/etc/environment vs /etc/profile:
environment is for all programs, profile is only for shells.
but shells also need the $PATH variable,
so including environment in profile does make sense, at least to me.