PATH inconsistency in EL7
Wednesday, 30, April 2014 Jim Perrin General 6 Comments

With the default gnome3 desktop in el7, opening a terminal via the menu sometimes presents the user with a different PATH variable than if they right click the desktop and choose 'Open in Terminal'.For some reason it appears that the user's .bash_profile is not always read, which means ~/bin and ~/.local/bin are sometimes missing from the $PATH. I've not been able to determine exactly what's causing this, but it can be incredibly frustrating. Sometimes a reboot works, sometimes not. This issue is not always present, which makes it a joy to try to narrow down.  The interim solution is done per user via .bashrc, or you can drop the following snippet into  /etc/profile.d/consistent-user-path.sh (with 644 permissions of course).

 

 

#!/bin/bash
# Fix broken nautilus-open-terminal
if ! echo ${PATH} | /bin/grep -q $HOME/bin ; then
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
fi

 

 

6 thoughts on "PATH inconsistency in EL7"

Leave a Reply

Your email address will not be published. Required fields are marked *