The default value of the PATH
environment variable in Ubuntu (13.10, at least)
for an administrator (user in the sudo
group) after logging in to the desktop environment is:
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
/usr/local/sbin and /usr/local/bin appear before /usr/sbin and /usr/bin. However, /usr/local/games appears after /usr/games.
Is there a reason for this? Or it's just a typo?
More information
Normal/administrator user's default
PATH
after logging withsu - user
:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Normal/administrator user's default
PATH
after logging in a virtual console:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Default
PATH
for theroot
user (after logging in withsudo -i
; I haven't tried enabling the root user and logging in through a virtual console):/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Content of /etc/environment:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Relevant line of /etc/sudoers:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Relevant lines of /etc/login.defs:
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Repeating the main question: what's the reason for /usr/local/games to appear
after /usr/games, instead of before, in the default PATH
?
And a related question: from where does the value of PATH
come from?
It seems /etc/environment and /etc/login.defs are both used in different situations.
/etc/environment
comes from, so now I/we can report a bug against a specific package! I'll report the bug and mark the accepted answer later today (in a few hours). – Feb 18 '14 at 14:19/etc/environment
? Could you have a look around? – Oli Feb 18 '14 at 14:51grep -C 5 "/etc/environment" /var/lib/dpkg/info/*
should help. – Oli Feb 18 '14 at 14:51libpam-modules
touch the file (it doesn't create it) and is normally empty. The package that provides the path is calledbase-files
which provides the/etc/profiles
and profiles contains the path. – Braiam Feb 18 '14 at 15:31