shell config /etc/profile does not set $PATH

Bug #1806728 reported by Milan Hauth
6
This bug affects 1 person
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/base-files/profile | wc -l
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:/usr/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/info/cracklib-runtime.postinst: 7: /var/lib/dpkg/info/cracklib-runtime.postinst: update-cracklib: not found
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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.