Questions tagged [environment-variables]
A set of dynamic variables that can affect the running processes behavior and access to resources.
1,025
questions
2
votes
1
answer
6k
views
How to make an environment variable available for a python program using os.environ module?
I'm just new in this site and new to all the GNU/Linux environment, I'm trying to access to an environment variable from a python program that I wrote in PyCharm, I created it but I the the variable ...
2
votes
2
answers
5k
views
what is the value for JAVA_HOME?
What is the correct value for JAVA_HOME?
thufir@doge:~$
thufir@doge:~$ whereis java
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
thufir@doge:~$
thufir@doge:~$ which java
/usr/...
1
vote
1
answer
6k
views
How to resolve java : not found?
I execute the command sudo cassandra -R to start cassandra and I get the following error.
getopt: invalid option -- 'R'
/usr/sbin/cassandra: 158: exec: java: not found
It points to the following ...
1
vote
0
answers
39
views
What should I use in instead of ~/.pam_environment (deprecated)?
I used to put user-specific settings like LANGUAGE and PAPERSIZE in ~/.pam_environment, but the manual and the warning emitted on login tells me:
Due to problematic security this functionality is ...
0
votes
1
answer
69
views
Trivial pursuit : bash environment variables
I know this works:
FNAME="$(basename $LD_PRELOAD)"
FNAME="${FNAME%.*}"
Can this be expressed in a single line? These are two unsuccessful attempts, thus far:
${$(basename ...
0
votes
1
answer
5k
views
How to solve Uiautomatorviewer issues: GDK_NATIVE_WINDOWS environment variable is not supported in GTK3
I have typed $uiautomatorviewer and got the error as
(java:642): Gdk-WARNING **: 00:33:28.349: The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.
See the documentation for ...
182
votes
8
answers
790k
views
How do I set environment variables?
I'm trying to set up Apache Tomcat on my pc, and it wants me to set up an environment variable for CATALINA_HOME. Does any know how to do this?
0
votes
0
answers
54
views
Environment variable not set in profile.d script
I created a script
/etc/profile.d/mkl_restriction.sh which contains the following line:
export MKL_NUM_THREADS=1
When I log in (via ssh if that matters), the variable is not set, but if I run source /...
0
votes
1
answer
1k
views
Installation of OpenModelica
I wished to install OpenModelica on my deb-based system, ubuntu 18.04.
For this purpose, I used the following commands:
echo "deb http://build.openmodelica.org/apt bionic stable" | sudo tee /...
2
votes
1
answer
426
views
non-login shell sources $HOME/[.local/]bin to $PATH and I can't find why
OS: Ubuntu Desktop 22.04
I am initially logged in as user carl. I open a shell and echo $0, I get the confirmation that I am in a non-login shell. ("bash", no dash)
But when I then echo $...
1
vote
2
answers
6k
views
What's the default proxy settings in Ubuntu 20.04?
Linux newbie here. I tried to set up system proxy by changing environment variables (such as "http_proxy"), but now I no longer need it. The problem is, I forgot what the default (not using ...
1
vote
1
answer
141
views
What are the implications of using PROMPT_COMMAND like this?
I would like to insert the return code of the last command in reverse red color and inside brackets ([]) plus a colon (:) just before the bash (PS1) prompt. But, only if the return code is non-zero, i....
0
votes
0
answers
52
views
How to add XAMPP MySQL Path in Ubuntu environment variable?
I'm a new Ubuntu (Kubuntu) user. I migrated from Windows. I want to add MySQL bin path to environment variable on Ubuntu (Kubuntu). How to do it? Please help me!
0
votes
0
answers
22
views
How do I modify /etc/environment? [duplicate]
I'm new to Ubuntu and I would like to add a new variable to /etc/environment as part of an installation (as detailed in the question linked below). I have attempted to modify environment by opening ...
4
votes
3
answers
4k
views
CLion doesn't pick up environment variables sourced in bashrc
Long Story (This is X)
TLDR / The Problem (This is Y)
Now, if running sh /opt/clion/bin/clion.sh from the Ubuntu terminal, CLion does pick up the environment variables sourced in the ~/.bashrc file, ...
1
vote
0
answers
245
views
Changing LS_COLORS in Ubuntu 22.04 works in terminal but not permanently in .bashrc
I am learning linux thoroughly, I have downloaded my first VM with vmware-fusion on my mac m1.
I have tried many times to update the .bashrc file but the one thing that is not changing for some reason ...
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.
...
3
votes
2
answers
7k
views
Unable to change QT_QPA_PLATFORMTHEME environment variable
Xubuntu 20.04 LTS
I want to change default XFCE theme for Qt applications. It's set to Fusion style on my app. I read from tutorials that I need kvantum manager and qt5ct
I installed both packages ...
29
votes
4
answers
11k
views
How to increase waiting time for non responding programs?
I have installed a Ubuntu GNOME and found that I am getting lots of PROGRAM is not responding messages.
I have either to "Force Quit" the program or "Wait" for it a little more.
I've noticed that ...
0
votes
1
answer
14k
views
Updating environment variables
I had to erase a previous Ubuntu version on my pc, and reinstall a new version (16.04 LTS) to work. After that, I installed the source code of several programs that I work with in the previous version....
4
votes
4
answers
247
views
How to make applications save dotfiles at a specified path?
Currently, all my config dotfiles and dotfolders (e.g. .cache,.adobe,.compiz) are in my $HOME folder. Is there a environment variable that I can specify which will make all applications save their ...
2
votes
1
answer
120
views
Auto-completion puts back-slash before $ mark, how can I disable it? (ubuntu 22.04)
To access files in a directory from another directory, I often set a variable for that directory. For example (so you can try it your self),
export dir1=/usr/local/bin
and then type ls $dir1/ ...
7
votes
2
answers
21k
views
Is $PATH in WSL supposed to be very long?
Anybody else get an extra long path using echo $PATH command? I'm working in BASH shell Ubuntu on windows from the Windows app store.
Output of echo $PATH:
home/mnhir/bin:/home/mnhir/.local/bin:/usr/...
0
votes
0
answers
60
views
X11 appears to be stuck on DISPLAY (:1) affecting nvim yank
My Problem
Today I discovered that my "native" display is :1 as seen below:
$ who
kwilkins :1 2023-11-27 22:13 (:1)
This is affecting the ability to yank in nvim. My only hope is ...
0
votes
1
answer
85
views
Alt+F2 doesn't run scripts from a folder added to PATH, but terminal does run it
I used to run scripts using Alt+F2 in Ubuntu 18.04, but they don't run in Ubuntu 22.04. However, they run properly if I run them from the terminal which uses zsh.
To modify the PATH variable I opened ...
1
vote
1
answer
995
views
ssh ignores variables in profile files
Apologies for this vague question in advance, but I don't know how to narrow this down.
I'm on Ubuntu 14.04.5 LTS, using OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.10, OpenSSL 1.0.1f 6 Jan 2014 as my ssh client....
4
votes
2
answers
2k
views
`http_proxy` not showing up with `printenv` on WSL
I am having trouble getting pip to work behind a corporate firewall. I added the http and https proxies to my /etc/environment file, and if I execute echo "$HTTP_PROXY" it prints the right thing. ...
16
votes
2
answers
10k
views
How to start/configure pulseaudio remotely with ssh?
I have a remote machine to which I can ssh. On the remote machine there is a program that uses pulse audio to get input from a USB microphone attached to the remote machine. This setup works fine when ...
2
votes
1
answer
2k
views
Running PHP runs as root instead of logged in user
I have a little development environment with a PHP script that only contains the following:
whichuser.php
<?php var_dump( exec('whoami') ); ?>
When I try to execute this "script" via CLI the ...
20
votes
4
answers
204k
views
Run PHP from the command line
I have installed XAMPP v1.8.3 for my PHP development. I am new to Ubuntu, so I don't know how to set environment variable for PHP which is located at /opt/lampp/bin/php.
I can run PHP scripts from ...
0
votes
0
answers
584
views
How to use Environment Module packages in Ubuntu
I have been a while in Fedora and other Linuxes, and I got used to loading "environment modules".
For example, in Fedora, I could install both mpich and openmpi (two implementations of the ...
0
votes
0
answers
74
views
Update PATH Variable in Byobu for root
I would like to add a directory to the $PATH variable for all users, including users who run byobu with sudo byobu.
I am running Ubuntu 22.04 LTS on x86_64.
The desired path is below. Note the ...
0
votes
2
answers
59
views
Bash function that checks if string argument is a name of existing (set) or not existing (unset) variable
I would like to write a bash function in Ubuntu 22.04 that works like that
Var1=100
is_variable_set "Var1" //Returns 0 (variable exists ie is set)
unset Var1
is_variable_set "Var1&...
1
vote
1
answer
49
views
Is it possible to monitor hidden file creation using auditctl? Ubuntu 20.04
I want to monitor creation of hidden files in /home/user. Is it possible to create a rule which triggers when any hidden file created in /home/user folder using auditctl? (* or any other methods?)
0
votes
1
answer
58
views
Is it possible to use environment variable (e.g. $HOME ) in auditctl ? Ubuntu 20.04
I'm trying to monitor /home/<user>/ folder.
I created # auditctl -w $HOME -p rwxa -k home_access rule. But it creates rule only for current user.
Is it possible to create such a rule that ...
2
votes
1
answer
3k
views
PHP Environment Variables in CLI
Environment Variables are used to set up the PHP application and the application runs smoothly.
The issue that I'm facing is when I'm trying to reference the application's database connection file and ...
0
votes
1
answer
287
views
How to set PATH, HOME, JAVA_HOME variables correctly for working with maven after Java-JDK installations?
I visited the webpage at https://help.ubuntu.com/community/EnvironmentVariables and find out about setting environment variables and local user variables and have got a pretty clear picture. But I am ...
1
vote
1
answer
209
views
Which environment variable controls the location of .local directory?
Due to storage space constraints in my home directory, I need to move as much out of there as possible. I have moved caches and configs out by setting the $XDG_CACHE_HOME and $XDG_CONFIG_HOME ...
0
votes
0
answers
157
views
rename file with name contains variable part
If i have file name (file_$i.txt). How I can change variable part in the name to be (file_$var.txt)
$i >> number of lines in file
$var >> content of other file
2
votes
2
answers
2k
views
How to solve "The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable" error?
I've installed Ubuntu 20.04.3 LTS and installed Anaconda3, but I had to uninstall Anaconda3 since some problem occurred. I removed it using this command as root and from the /home/user directory:
# rm ...
0
votes
2
answers
6k
views
Ubuntu 22.04 no_proxy seems to be ignored
Proxy has been configured using both the System Settings UI for Network Proxy and the environment variables http_proxy, https_proxy and no_proxy (and also the uppercase versions).
The environment ...
2
votes
1
answer
5k
views
ERROR: JAVA_HOME environment variable must be defined
I installed Java using
apt install default-jre
apt install default-jdk
whenever I tries to access an app, getting an ERROR:
JAVA_HOME environment variable must be defined
How I can define Java home ...
0
votes
1
answer
190
views
Pain with Maven and Java env variables
So I installed Java following this guide as I did many times, and set $JAVA_HOME in /etc/environment, java -version works fine.
After that I'm following this guide as I did many times and install ...
22
votes
8
answers
18k
views
Setting TeX Live path for root
I have installed TeX Live 2011 vanilla and I have trouble setting the TeX Live path for root (in Ubuntu 11.10).
The problem is that when I run sudo tlmgr I get:
sudo: tlmgr: command not found
To ...
0
votes
2
answers
8k
views
My PATH variable resets itself when closing terminal
I want to add texlive's directory to my PATH, so i type export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux and it update the PATH variable correctly. I can use commands listed in texlive path, ...
48
votes
4
answers
209k
views
How can I reset $PATH to its default value in Ubuntu?
I accidentally unset all the directories of $PATH while trying to add a new one in ~/.bashrc. I opened a new terminal window as I was editing and now $PATH is empty. I'm worried if I boot from another ...
132
votes
3
answers
98k
views
Set variable in .desktop file
Is there a way to set the enviroment variable in .desktop file?
I'm trying to run application (eclipse) with custom gtk style, so basically I want to get the following result by runing a .desktop file:...
0
votes
1
answer
280
views
source command not working in Ubuntu 20.04, complains about missing directory
I'm trying to reinstall openssl library on Ubuntu 20.04 according to https://docs.openiam.com/docs-4.2.1.3/appendix/2-openssl and I'm stuck at the last step.
I have to reload the environment variables,...
1
vote
3
answers
5k
views
Where is XDG_CONFIG_DIRS set?
If my understanding is correct, Ubuntu and variants set XDG_CONFIG_DIRS to something like
XDG_CONFIG_DIRS=/etc/xdg/xdg-$VARIANT:/etc/xdg
Then, package-provided system-wide configuration defaults in /...
0
votes
0
answers
32
views
What is the best way to temporarily set an enviornmental varabile?
I'm building a breathalyzer for my computer. If the breathalyzer fails, I want to set an environmental variable to make all instances of the web-browser to open in incognito mode.
Im debating whether ...