Results 1 to 6 of 6

Thread: Environment variables

  1. #1

    Default Environment variables

    Hi,

    I'm confused about how environment variables are set in OpenSuse (Tumbleweed 2019), I've read several very interesing Howtos, but not specific on OpenSuse so I always end up struggling to understand

    In fact it started some days ago when I installed jack-rack, and got the message

    No LADSPA plugins were found!

    Check your LADSPA_PATH environment variable.
    so I checked with

    Code:
    printenv |grep LAD
    and indeed the path wasn't set

    so with

    Code:
    export LADSPA_PATH=/usr/lib64/ladspa
    I could launch jack-rack from the command line and all goes well

    Starting it from the start menu however take the path into account

    And as the 'export' wouldn't survive a reboot I searched on ho to add it to boot, for specific user or systemwide, but til now I had no success; several online posts suggested to look into /etc/environment but all there is is :
    Code:
    #
    # This file is parsed by pam_env module
    #
    # Syntax: simple "KEY=VAL" pairs on seperate lines
    #
    And I couldn't get further in my inquiries

    Can anyone give me a simple hint on hot to add/remove an environment valiable in OpenSuse either user or system wide and that survive reboot?

    Sorry if that question is basic but it's sort of troubling me

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,178
    Blog Entries
    3

    Default Re: Environment variables

    The traditional place to set environment variables, is in your shell startup files. That would be ".profile" or ".bashrc".

    For "csh" users, that would be ".login" or ".cshrc".
    openSUSE Leap 15.1; KDE Plasma 5;

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,822
    Blog Entries
    1

    Default Re: Environment variables

    Depends on whether you wish to add to your User specific paths (as nrickert suggests) or to your system.
    To add to your system, you are not supposed to modify /etc/profile directly (You can open that in a text editor and read about this warning), you are supposed to create a file /etc/profile.local with your export command in it. The alternative is to create a script file with your export command and place in the directory /etc/profile.d/ where you can find other scripts which you can inspect and use as examples.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: Environment variables

    Thanks a lot for that quick response, it works indeed to put my export in .bashrc; the strange thing is that there is not much in there, Where are all the other variables stored like ie
    Code:
    PATH=/home/atuor/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin
    A central place or are they loaded at startup by some other modules ?

    If you know a good reading on that would be great

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,822
    Blog Entries
    1

    Default Re: Environment variables

    Quote Originally Posted by a_tuor View Post
    Thanks a lot for that quick response, it works indeed to put my export in .bashrc; the strange thing is that there is not much in there, Where are all the other variables stored like ie
    Code:
    PATH=/home/atuor/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin
    A central place or are they loaded at startup by some other modules ?

    If you know a good reading on that would be great
    A good starting point is to read the file /etc/profile

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,582

    Default Re: Environment variables

    Basically the environment is specific to each thread and generally it is initially inherited from the parent thread/process.

    So changing it in one thread does not change it in all but the change would be inherited by subsequent processes created in that thread. So you can set it as per the above instruction for either local to a user or system wide for all users.

Posting Permissions

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