Results 1 to 4 of 4

Thread: Not able to set systemwide path

  1. #1
    Join Date
    Jul 2014
    Beans
    2

    Not able to set systemwide path

    Hi,

    I have been trying for days to add some directories to the path in ubuntu 14.04 in a way that is set for all users instantly.
    I tried creating a file in profile.d, adding the path in /etc/profile, in /etc/environment. Everytime the same: I open the terminal and the path is back to its original state.
    I found something related to it being a case of interactive login and interactive not-login shells. If I open a terminal in a graphical ubuntu, it is an interactive not-login shell and ignores those files previously mentioned. If I login with an interactive login shell, the path is adjusted.
    I need a way to add for instance /usr/local/bedtools/ to the path in such a way that it is available to all users, in interactive login and not-login shells.
    Does anyone know how to accomplish this?
    Last edited by Stijn_T; July 1st, 2014 at 09:13 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Not able to set systemwide path

    I found this on askubuntu http://askubuntu.com/questions/60218...ory-to-my-path with a quick search, but have no experience of using it so be prepared to find that either it does not work, or for others to tell you another way to add the new $PATH variable.
    To set it system wide, append the line
    Code:
    export PATH=/path/you/are/adding:$PATH
    to the end of /etc/profile.

    To add the directory for only the logged-in user, append the same line to ~/.bash_profile.

  3. #3
    Join Date
    Jul 2014
    Beans
    2

    Re: Not able to set systemwide path

    Thanks for the reply. Unfortunatley, that only works for a login shell.
    When you log into a graphical ubuntu, it uses that path. But when you open a terminal inside that graphical ubuntu, it is no login shell and thus it doesn't read that file.
    I am looking for a way so that bash also reads /etc/profile.

  4. #4
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Not able to set systemwide path

    Welcome. Are you starting your commands with 'sudo'?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •