/etc/profile does not get sourced when logging into a terminal window
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnome-terminal (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I wanted to change the command prompt and so made the following change within /etc/bash.bashrc:
#PS1='$
PS1='${
When a terminal window is opened, the prompt is unchanged from the original. If I reboot, login and again open a terminal window the prompt is still unchanged. However, manually executing the following from the terminal window changes the prompt as desired:
source /etc/profile
It seems that /etc/profile is not automatically run when the terminal window is first opened.
From the documentation I've seen (https:/
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 3.13.0-43-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: Unity
Date: Thu Jan 1 14:36:48 2015
InstallationDate: Installed on 2014-09-12 (111 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
PackageArchitec
SourcePackage: ubuntu-
Symptom: dist-upgrade
UpgradeStatus: No upgrade log present (probably fresh install)
affects: | ubuntu-release-upgrader (Ubuntu) → gnome-terminal (Ubuntu) |
Ubuntu's default ~/.bashrc (copied over from /etc/skel/.bashrc when you create new user accounts) overrides PS1 when $TERM is xterm*. When you open new terminal windows or tabs, bash sources /etc/bash.bashrc and then ~/.bashrc, and thus your global PS1 setting is overwritten.
Do the change in ~/.bashrc instead of in /etc and you'll be fine.