Results 1 to 6 of 6

Thread: 13.04, Environment and search path not permanent

  1. #1
    Join Date
    Jan 2013
    Beans
    181

    13.04, Environment and search path not permanent

    Hi. I'm using Asus 1225B. I'm trying to get NCL running in my Ubuntu 13.04. The instructions are here http://www.ncl.ucar.edu/Download/install.shtml . 'uname -m' gives me i686. I downloaded the Debian version for i686. Followed the instructions. And its running. Now here's the problem, everytime I restart my laptop, when I typed the command 'ncl' its not working. What I found out is that when I repeat the instructions 'Set the NCARG_ROOT environment variable and your search path to where NCL/NCARG resides', its working as it supposed to be. When I restarted, its not working anymore. I assume I should do the bash instructions instead of sh instructions. is this correct?

    From bash or ksh (the file might be ".bash_profile" or ".bashrc" or ".bash_profile"):
    export NCARG_ROOT=/usr/local/ncl-6.1.2
    export PATH=$NCARG_ROOT/bin:$PATH

    I absolutely have no idea what to do about this.

    Edit: Okay, I tested it again, apparently closing the terminal emulator also 'reset' this. So I have to open the terminal emulator, and type in those instructions before I can use NCL again. How do I solve this?
    Last edited by zemega; August 26th, 2013 at 03:40 PM.

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,660
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.04, Environment and search path not permanent

    Hi zemega.

    For system-wide (all users), add the path here:
    Code:
    /etc/environment
    For instance, something like this:
    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ncl-6.1.2/bin"
    As per user basis, set this file in the users' home:
    Code:
    ~/.pam_environment
    For example:
    Code:
    PATH DEFAULT=${PATH}:/usr/local/ncl-6.1.2/bin
    Note that the syntax is different.

    Here's a good tutorial about environment variables.

    Hope it helps. Let us know how it goes.
    Regards.

    Note: this is for Ubuntu. I'm not sure if this applies for Debian at this point.
    Last edited by papibe; August 26th, 2013 at 04:05 PM. Reason: added note and link.

  3. #3
    Join Date
    Jan 2013
    Beans
    181

    Re: 13.04, Environment and search path not permanent

    I remember that ~ is /home/something . How do I make NCARG_ROOT = /usr/local/ncl-6.1.2 ?

    Edit:
    When I put PATH DEFAULT=${PATH}:/usr/local/ncl-6.1.2/bin in the /etc/environment, log out and log in again, running ncl gives different error. So I think that NCARG_ROOT is hardcoded into the application. So I think I need to set into Ubuntu that NCARG_ROOT is equal to /usr/local/ncl-6.1.2 . Is this a correct approach?
    Last edited by zemega; August 26th, 2013 at 05:28 PM.

  4. #4
    Join Date
    Jan 2013
    Beans
    181

    Re: 13.04, Environment and search path not permanent

    Okay, I think I solved this. I edited /etc/environment to be like this:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ncl-6.1.2/bin"
    export NCARG_ROOT="/usr/local/ncl-6.1.2"

    And the magic step is to log out and log in again. Before I edited ~.profile, ~.bashrc, and /etc/environment. When I restarted the laptop, it got stuck into infinite loop after splash and before logging in. I'm going to be working for a few hours before I try restarting this laptop again to see if I have any problems, so I'll report back later.

  5. #5
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,660
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.04, Environment and search path not permanent

    Don't use the keyword 'export' on /etc/environment.

    This would do fine:
    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ncl-6.1.2/bin"
    NCARG_ROOT="/usr/local/ncl-6.1.2"
    Regards.

  6. #6
    Join Date
    Jan 2013
    Beans
    181

    Re: 13.04, Environment and search path not permanent

    That's true, I'm going to mark this as solved. Anyway, this forum really needs a sticky thread of what to do in Ubuntu when the instruction gives general Linux instructions, when Ubuntu apparently changed many things.

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
  •