Questions tagged [environment-variables]
A set of dynamic variables that can affect the running processes behavior and access to resources.
1,025
questions
1
vote
1
answer
3k
views
Set path to Eclipse
My Eclipse installer has installed Eclipse in ~/eclipse/cpp-oxygen/eclipse. But I don't have its icon in the Unity menu and command prompt doesn't see the eclipse binary.
I have set PATH in .profile ...
3
votes
3
answers
12k
views
How can I find where the vim executable is located when my PATH is broken?
Looks like I crashed my system after editing /etc/environment and .bashrc files.
My desktop doesn't start and I need to correct these files back. But since my system doesn't find any commands I need ...
0
votes
0
answers
306
views
pig -version Shows error
deepak@deepak-Linux:~$ pig -version
/usr/local/hadoop/bin/hadoop: line 166: /usr//bin/java: No such file or directory
deepak@deepak-Linux:~$ echo $JAVA_HOME
/usr/java/jdk-9.0.1
deepak@deepak-Linux:~$...
0
votes
1
answer
3k
views
/usr/sbin/update-info-dir: 1: /etc/environment: JAVA_HOME: not found
I'm trying to install nginx.
By Running : apt-get install nginx
it fails throwing a strange error saying that there is no JAVA_HOME
Lokking to my /etc/environment file , it looks like this :
...
11
votes
3
answers
5k
views
Correcting path setting in ~/.profile file
There is a line in ~/.profile which is
PATH="$HOME/bin:$HOME/.local/bin:$PATH"i
I'm not sure about the last i.
Should I remove it??
Isn't it a syntax error??
9
votes
3
answers
3k
views
EDITOR environment variable changes after reboot
While running the less command, pressing v opens the file inside the editor. I have set the EDITOR environment variable to vi by running the command export EDITOR=vi.
It works perfectly fine as ...
2
votes
0
answers
507
views
sudo su -l does not preserve environment variable [duplicate]
firstly, look at the snippet below:
$ ssh -i ~/.ssh/ubuntu.pem [email protected]
ubuntu@kingdom:~$ echo $PATH | tr ':' '\n' | grep sbin
/usr/local/sbin
/usr/sbin
/sbin
ubuntu@kingdom:~$ sudo su -l ...
0
votes
1
answer
1k
views
PATH environment variable behaviour when switching user with and without login
when i login as a user then switch to another one, the PATH environment variable changes when the switch is done with and without login. see the following snippet
$ ssh -i ~/.ssh/ubuntu.pem ubuntu@...
10
votes
3
answers
8k
views
Equivalent to `setx` in powershell
Windows has a powershell command called setx which Creates or modifies environment variables in the user or system environment.
Does Ubuntu has a similar command, i.e. not by using nano or vi, just ...
0
votes
1
answer
301
views
Glade 3.20 seems to ignore `GLADE_CATALOG_PATH`
I have created a catalog with a custom widget and a custom group. If I set the GLADE_CATALOG_PATH variable and launch glade, the group and the widget are not shown. I have used both relative and ...
3
votes
2
answers
13k
views
How do I set environment variable for all users even when doing sudo su?
I created a file named x.sh in the directory /etc/profile.d/ so it should be accessible to all users. I expected when I change the current user in terminal (of logged-in user) using command sudo su ...
0
votes
0
answers
3k
views
No Java virtual machine could be found from your path
I am trying to install a program that is using Java, but it gets stuck when searching for the JVM.
Running java -version I get openjdk version 1.8.0_151
My current $PATH parameter contains /usr/lib/...
4
votes
4
answers
22k
views
How to set "MKL_THREADING_LAYER=GNU" as an environment variable for a python script?
When I run a py script there is an error like this
RuntimeError: To use MKL 2018 with Theano you MUST set "MKL_THREADING_LAYER=GNU"
in your environement.
I googled why and in the ...
1
vote
1
answer
262
views
Variable not stored while executing bash commands via gnome-terminal
I have a plugin that generates and copies to the clipboard a ready-to-paste command which then creates a file that I want to move and rename via user input.
If I use this to get the latest modified ...
59
votes
2
answers
84k
views
DEBIAN_FRONTEND environment variable
My potential hosting provider suggests to run a command in the terminal in order to make KVM based server's OS image minimal. Since their KVM templates come with packages I will not need, I thought I ...
0
votes
0
answers
47
views
$PATH: Seemingly several definitions, and yet unable to modify it
For a while now I've been struggling to deal with my $PATH variable but up until now I've always given up on it. This time, I've had enough, and after scouring AskUbuntu I can't find anything that ...
3
votes
2
answers
1k
views
Environment variable
I need to install a software called silico.In that software it says
Copy the Silico directory tree to an appropriate location
Set the environment variable SILICO_HOME to point to the silico directory
...
1
vote
2
answers
3k
views
How do I fix "MANPATH: undefined variable." in csh?
I am installing some open source software by compiling its source code -- on Ubuntu 16.04 -- by following the instructions in its 'readme' file. At certain point (point 3b in the link) the guideline ...
10
votes
2
answers
6k
views
Why aren't variables like $PS1 in printenv?
From what I can tell printenv displays environment variables, but why don't I see other variables like PS1 for customizing the shell prompt?
What exactly is printenv outputting and why doesn't it ...
1
vote
2
answers
17k
views
cd /var/www/html/ error
I am Trying to install angular4 but in the process I type this command:
cd /var/www/html/
As referred by the video but the error showing is this:
bash: cd: /var/www/html/: No such file or directory
3
votes
1
answer
2k
views
Can't cd to newly added Path variable [duplicate]
I added the following line to /etc/environment:
ML="$HOME/ml"
After I re-logged in for the script to take effect, running
printenv ML prints $HOME/ml and running cd $ML prints
bash: cd: $HOME/ml: ...
0
votes
1
answer
1k
views
Where is the NiViewer in Ubuntu 16.04 LTS?
I am pretty much new to Ubuntu file and directory system. I installed OpenNi2 using sudo apt install libopenni2-dev but now could not find the NiViewer executable to test the installation. I looked in ...
6
votes
1
answer
20k
views
UBUNTU 16.04: How to set JAVA_HOME for Java?
I am following this
How to set JAVA_HOME for Java?
in order to set the environment variable JAVA_HOME to the correct version. I have different versions of java in my /usr/lib/jvm/folder as ...
0
votes
1
answer
7k
views
JAVA_HOME variable shows a blank line on the terminal
I'm using Ubuntu 16.04 64-bit. I'm logged in to Ubuntu as user1. I installed Oracle JDK version jdk1.8.0_144 to /usr/local/java and set symlinks as
$ sudo update-alternatives --install "/usr/bin/java"...
8
votes
1
answer
3k
views
What is the difference between env, declare and compgen -v?
I see that printenv and env are giving the same output. When digging further for getting the complete list of environment variables, I found declare -xp and the command from here:
compgen -v | ...
1
vote
1
answer
1k
views
How can I get bash to evaluate a PM2 command stored in a Variable?
I'm setting up a server config with cloud init and am running commands one after another in the config file.
One of the commands I need to run to setup my server's environment is PM2 to keep a node ...
0
votes
0
answers
5k
views
setting a permanent environment variable
I am trying to permanently add an environment variable in ubuntu 16.04.3 LTS.
I have tried many of the online solutions but none are working.
I have tried adding:
export PLINK_PATH=/usr/local/bin/...
-2
votes
3
answers
10k
views
Help adding directory to PATH environment variable in Ubuntu 16.04
How do I add "/home/me/pycharm-edu-4.0/bin/" to my PATH environment variable? I've tried what's in How to set $PATH in Ubuntu and What is the PATH environment variable and how do I add to it? but I ...
17
votes
1
answer
60k
views
How to set LD_LIBRARY_PATH permanently?
I am using Ubuntu 16. I want to use cfmid for my project. When I set LD_LIBRARY_PATH in terminal, I can get output of the cfmid library:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lclab/installed/...
0
votes
0
answers
113
views
Change Environment variables through sudo script
I have a script script_xy.sh, which I have to execute via sudo.
In this script I modify environment variables and when I add the line source ${BASHRC} nothing happens, because it doesn't refer on the ...
-1
votes
3
answers
2k
views
Unable to set JAVA_HOMEin Ubuntu with space in path in /etc/environment
I am annoyed trying this but all I am trying to do is set JAVA_HOME in /etc/environment file in Bash shell on Windows which is being offered now with Windows. My local Java is at C:\Program Files\Java\...
1
vote
2
answers
4k
views
Stuck in login loop due to change in Path variable
The output of echo path is:
/home/adarsh/Downloads/android-studio/gradle/gradle-3.2/bin:/snap/bin
I was trying to add gradle to my path variable but unknowingly I made some mistake, next time I ...
1
vote
1
answer
1k
views
Reset python from 3 to 2 after anaconda modified PATH
I've installed anaconda and last thing it asked was if it could change the path. It actually installed python 3
samuel@samuel-pc:~$ python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016,...
0
votes
1
answer
1k
views
Setting "$PATH" environment for Unix "which" command
I am trying to run two chemistry programs together that need the PATH environment changed in order to find one another. The manual says:
Under the UNIX operating systems, R.E.D. looks for the "...
0
votes
1
answer
503
views
issue with spaces in directory name for profile variable
I am trying to create a variable for a directory that has a space in its name in my profile.
It looks something like:
variable=/path/to/directory/with space/; export $variable
I have tried many ...
3
votes
1
answer
2k
views
Grass 7.2.1 error in Ubuntu 17.04 "failed to connect to session manager"
I recently installed Ubuntu 17.04 Desktop and GRASS GIS. While opening GRASS GIS I get this error:
Debug: failed to connect to session manager: SESSION_MANAGER environment variable not defined?
Any ...
10
votes
3
answers
5k
views
Where is this environment variable set?
Whenever I open a terminal I have this variable set:
$ echo $http_proxy
http://127.0.0.1:8888/
Where is this variable being set? I've checked .bashrc, .bash_profile, /etc/bash.bashrc and /etc/...
0
votes
3
answers
911
views
How do I extract the value a script assigns to an environment variable, from outside the script?
I have two .sh files (say test1.sh and test2.sh).
test1.sh contains:
export OMP_NUM_THREADS=8
test2.sh contains:
export OMP_NUM_THREADS=4
Both files contain many other shell commands as well.
...
4
votes
1
answer
3k
views
What're the differences between "display", "display-device", "monitor", "screen" in /etc/X11/xorg.conf and the $DISPLAY environment variable?
In the xorg.conf file there are
_ Section "Screen"
_ Section "Monitor"
_ Option "UseDisplayDevice" (inside the screen section)
plus the $DISPLAY environment variable.
Which one of those 4 (screen,...
3
votes
1
answer
2k
views
Which of these Paths should I use as the value of JAVA_HOME?
I am running Ubuntu 16.04. I have downloaded JDK 7.0 from Oracle website and untar'ed and put it in a folder /opt/JDK/, such that the final install directory is /opt/JDK/jdk1.7.0_80 Then I executed ...
0
votes
1
answer
5k
views
/etc/environment changes reload immediatly in Ubuntu 16.04 but not in 14.04
I noticed that changing the content of /etc/environment in Ubuntu 16.04.1 immediately updates the output of env while doing this in Ubuntu 14.04.4 doesn't update the output of env (which requires you ...
1
vote
2
answers
367
views
Automatically send file input to command using expanded variables
I need to send some credentials defined in a file to a vpn connection command which is waiting for username and password to be entered when executed. There is a similar requirement to my question ...
8
votes
2
answers
4k
views
Run a Command-line Program with an Environment Variable
I am using the mpv media player to play my videos. I have a laptop with hybrid graphics so in order to use the discrete GPU I must use DRI_PRIME=1 mpv video.mp4 whenever I want to run mpv with the ...
0
votes
1
answer
4k
views
sumo simulator is showing "SUMO_HOME variable not set" and "unable to connect"
my@my-HP-15-Notebook-PC:~$ cd iitk/
my@my-HP-15-Notebook-PC:~/iitk$ netconvert --osm-files iitk.osm -o iitk.net.xml
Warning: Environment variable SUMO_HOME is not set, using built in type maps.
...
0
votes
1
answer
2k
views
Why is running localedef not creating my new locale in /etc/locale.gen?
I am trying to create a new system locale. I have studied the directions at Unix Stackexchange and at Ask Ubuntu but my attempts to get my environment variable into /etc/locale.gen have been ...
1
vote
1
answer
74
views
Understanding the export command: Becomes the variable in already started child processes?
I still struggle with understanding the export command.
I know that it is for making variables, which are defined in a console or script, available to child processes of the console / script.
But ...
0
votes
1
answer
573
views
ssh login to server pops the error " Bad : modifier in $ (/) "
I am trying to login to my remote machine (Fedora machine) from my local machine (Ubuntu 14.04).
I receive a typical error which seems related to setting of environment variables in my remote ...
4
votes
1
answer
17k
views
exporting environment variable using .sh file
so I have create setup.sh file like this :
#!/bin/bash
export SP_TWITTER_KEY=adsfad
export SP_TWITTER_SECRET=aadsfadsf
export SP_TWITTER_ACCESSTOKEN=asdfasdfa
export SP_TWITTER_ACCESSSECRET=...
10
votes
3
answers
22k
views
How to get the value of an exported variable in the console
If I wrote
export COMP_WORDS="this words"
I need something like
get-exported COMP_WORDS
expecting something like
COMP_WORDS="this words"
I tried
set | grep COMP_WORDS
but it takes others lines
2
votes
1
answer
14k
views
Get anaconda root directory
l'm looking to get my anaconda root directory. so l run :
which anaconda3
l got
/root/anaconda3/bin/anaconda
Is that my anaconda root directory ?