Results 1 to 3 of 3

Thread: Permanent changes to PATH

  1. #1
    Join Date
    Jul 2010
    Location
    Mumbai
    Beans
    3
    Distro
    Ubuntu

    Permanent changes to PATH

    Hello

    I have recently installed NS2, a network simulator. After installation, I need to add append some directory locations to PATH environment variable. Apparently, this can be done temporarily by doing-

    PATH=$PATH:/home/pereira/Downloads/ns-allinone-2.34/bin:/home/pereira/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/pereira/Downloads/ns-allinone-2.34/tk8.4.18/unix

    However on restarting the terminal, these additions will not be there. How do I make the changes permanent? On some Google search, some suggestions were to make changes to bash_profile or .profile located in home directory(Could not find this one).

    Secondly, I have to add some variables permanently to env. I did this temporarily by

    LD_LIBRARY_PATH=/home/pereira/Downloads/ns-allinone-2.34/otcl-1.13:/home/pereira/Downloads/ns-allinone-2.34/lib
    export LD_LIBRARY_PATH
    TCL_LIBRARY=/home/pereira/Downloads/ns-allinone-2.34/tcl8.4.18/library
    export TCL_LIBRARY

    and then typing env reflects these changes. How to make these additions permanent?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2006
    Location
    Tucson, AZ
    Beans
    1,420
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Permanent changes to PATH

    The best place for per-user customization is in the file ~/.bashrc. Just modify the PATH in there (followed by "export PATH").

    This is also the proper place for those other environment variables.

    Note that changes will not be reflected immediately after changing .bashrc - you'll need to close the terminal window and open a new one before the changes take effect.

    Lloyd B.
    Don't tell me to get a life.
    I had one once.
    It sucked.

  3. #3
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Permanent changes to PATH

    You can make system-wide changes to PATH by adding what lloyd suggested to /etc/environment.

    e.g.
    Code:
    PATH=$PATH:/usr/local/bin
    export PATH
    I'm not too sure about the "export PATH" part. It may or may not be necessary, but it doesn't hurt to include it anyway.
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

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
  •