Questions tagged [environment-variables]
A set of dynamic variables that can affect the running processes behavior and access to resources.
1,025
questions
0
votes
1
answer
145
views
Problem with setting a environment variable
I want to add Intellij Idea to be able to use ./idea.sh outside of my bin directory.
I edited my .bashrc to add export PATH=$PATH:/home/xenia/idea-IE-202.7319.78/bin at the bottom of my file.
Then, I ...
0
votes
1
answer
557
views
bash: Declare local variable in the for expression
This function:
function prova {
for (( i=1; i<=5; i++ )); do echo test; done
return $?
}
Returns:
test
test
test
test
test
This other instead:
function prova {
for (( local i=1; i<=...
1
vote
0
answers
931
views
Python sees LD_LIBRARY_PATH only when executing as root (Ubuntu 20.04)
I am facing a tricky problem with LD_LIBRARY_PATH in python3.8 on Ubuntu 20.04.1.
When I execute with my user the following lines:
user@host>export LD_LIBRARY_PATH=/usr/lib
user@host>echo $...
2
votes
1
answer
385
views
How do gsettings interact and/or conflict with exported enviroment variables? (Ubuntu 20.04)
I am behind a corporate fire wall and have been trying to set up my proxy settings by using export in a shell script located in /etc/profile.d/proxy.sh (see, e.g., How to set system-wide proxy ...
1
vote
0
answers
2k
views
How to reset PYTHONPATH to earlier value
I had been tinkering with PYTHONPATH for some work and wrote the following in my .zshrc file:
export PYTHONPATH="someDirectories:aFewMoreDirectories"
I then sourced the .zshrc file and then ...
0
votes
1
answer
1k
views
Java Installation in Ubuntu 20.4 [duplicate]
This is my first time of using Ubuntu. I am trying to install java jdk-15 in my lap.I applied following steps.
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-15/bin/java 1
...
4
votes
2
answers
7k
views
What are the default LS_COLORS and DIR_COLORS values in Ubuntu?
I'd like to have Ubuntu style on my system's terminal, which is not Ubuntu. Could someone be so kind to post the values of unmodified original $LS_COLORS and $DIR_COLORS here from his/her Ubuntu ...
0
votes
1
answer
2k
views
why pip is not installed but after creating new venv and activating it, pip does work?
I'm confused by venv in linux.
I have a fresh ubuntu 20.04 installed. when I entered python in terminal it says command python is not found and the same for pip, but python3 works (still not for pip ...
0
votes
0
answers
1k
views
Unable to export permanently environment variables from bashrc
I am having huge problems with my PATH and LD_LIBRARY_PATH since I have installed new libraries. Generally speaking: I can't export permanently my PATH variables defined in my ~/.bashrc file. As ...
0
votes
0
answers
420
views
Unable to source zshrc during a terminal emulator's startup
Installed Tilix terminal emulator on Ubuntu 16.04 virtual machine and configured a json theme to my liking named theme.json.
I have added the same environment variables and aliases both in the .bashrc ...
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 ...
0
votes
0
answers
25
views
TAB does't work properly with `cp` command when using environment variables [duplicate]
Question
When using cp command with environment variables, why pressing TAB for auto-complete doesn't work properly?
Description
I have a directory $HOME/Music; I want to copy a file from within this ...
0
votes
0
answers
169
views
Set Python environment used at startup/command prompt
I noticed that on startup and from the command prompt (ALT + F2) Ubuntu uses a different Python environment (namely 2.7.17) than what it uses from terminal (currently 3.7.7)
(I checked the command ...
0
votes
0
answers
1k
views
Problem of setting environment variables for installation of OpenFOAM-8
I followed the instruction on website https://openfoam.org/download/8-source/ to install OpenFOAM-8 with Ubuntu 18.04 LTS, every step was great until the setting of environment variables. Like the ...
0
votes
2
answers
524
views
Lubuntu 20.04 (LXQt): Which file(s) assigns the preset bash Environment Variables?
Which file(s) assigns the preset Environment variables listed by bash printenv or env on Lubuntu (LXQt & LXDE, if they are different)?
Are the same files used for other:
Debian-based distros
Non-...
0
votes
0
answers
565
views
sudo su - does not honor /etc/environment
I have set a PATH variable in /etc/environment. When I log into my system as root, the path variable is correctly applied. However, when I log in as another user and then become root via
sudo su -
/...
1
vote
0
answers
149
views
How do I code switches with the dash in bash shell scripts?
So I'm writing a bash shell script for launching dockers to control whether they are interactive or persistent after instantiating, and give them a name. In the command line I will include the ...
0
votes
1
answer
3k
views
No such file or directory: '/home/mona/anaconda3/lib/python3.7/site-packages/google_pasta-0.2.0.dist-info/METADATA'
How can I install tensorflow gpu 1.14 in Ubuntu 20.04?
Using the following command I got the error
(base) mona@mona:~$ pip install tensorflow-gpu==1.14
Collecting tensorflow-gpu==1.14
Downloading ...
1
vote
1
answer
2k
views
How to set environment variable for the updated youtube-dl installed from pip3?
I referred to an answer here to install youtube-dl using pip.
Although youtube-dl was installed by default in my Ubuntu 20.04, by apt, but it was outdated and showing errors.
Besides, I used pip3 to ...
5
votes
2
answers
1k
views
Can't pass the variable into other command
I was trying to pass a variable another shell command.
To be clear;
passwdContent=$( getent passwd "$USER" )
echo "passwdcontent" $passwdContent
I get the "passwd" field ...
0
votes
1
answer
3k
views
JAVA_HOME variable is Set but not working 20.04 - PLEASE HELP.!
I have installed:
Openjdk "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-posto-Ubuntu-3ubuntu1 )
OpenJDK 64-bIT sERVER vm (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, ...
0
votes
0
answers
2k
views
How to set environment variables for executable file
I recently installed vcgencmd on my Raspberry Pi with Ubuntu ARM64;
but I can't use vcgencmd command in .sh file without writing PATH=$PATH in it.
I can use it normally on terminal.
I tried adding
...
1
vote
1
answer
515
views
.profile not beeing sourced
some time ago I installed byobu and ran byobu-enable and it still didn't started automatically, I just ignored it since I could just press super and open up byobu terminal directly. But now I tried to ...
0
votes
1
answer
47
views
zero length variable added to for iteration not working
The question is simple . I have the following script in bash :
#!/bin/bash
a=`echo " 1 2 3 hello " | egrep -o "1"`
b=`echo " 1 2 3 hello " | egrep -o "2"`
c=`...
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 /...
0
votes
1
answer
2k
views
running jvmtop profile & the JAVA_HOME environment variable
Note: It seems jvmtop is simply broken with Java 11. I would also accept alternative Java process profiling options for Ubuntu 20.04 (terminal only) & Java 11, if instructions for installation and ...
0
votes
1
answer
841
views
How to make an environment variable (cern root) permanently?
I am pretty new with Ubuntu as the Windows subsystem. I've been trying to run the ROOT data analysis framework (change its path to make it available permanently) but for some reason is not working as ...
0
votes
2
answers
865
views
Problem with environment variable?
When I type echo at here:
skyI@skyI-MP-i1640:~$ echo $XDG_RUNTIME_DIR
/run/user/1000
It displays /run/user/1000, but when type echo here:
root@skyI-MP-i1640:/SLAM/DSO/dso# echo $...
0
votes
0
answers
1k
views
How to refer environment variable in terminal command?
I am new to Linux world, here i am trying to pass the env variable in command to aws in this way
sudo aws s3 cp s3://bucket/path/to/file.sh file.sh
Should download the file.sh to my local, here i ...
9
votes
1
answer
3k
views
Bash doesn't expand variables when pressing Tab key
In the previous versions of Ubuntu 18.04, the variables in Bash are expanded when I press the Tab key. But in Ubuntu 20.04 (using bash 5.0.16), the variables are not expanded. Instead, the dollar sign ...
3
votes
1
answer
2k
views
How to disable automatic backslash insert when using environment variable names on Ubuntu 20.04 LTS terminal(s)
When I use environment variable name and press Tab for auto-complete on Ubuntu 20.04 LTS terminal (I have tested both the terminal which comes with Ubuntu 20.04 LTS install and Terminator, same ...
0
votes
0
answers
27
views
RubyMine doesn't recognize user created environment variables [duplicate]
TLDR: Basically RubyMine does not recognize any user created environment variable when launched from a desktop entry, but when launched from console (using $ mine) it can recognize all the environment ...
3
votes
2
answers
5k
views
How to set environment variable in .NET systemd service?
I have virtual machine of Linux with Ubuntu 18. When I am running this command
sudo systemctl start myservice.service
Getting error
● myservice.service - dummyservice in .NET Loaded: loaded (/lib/...
0
votes
1
answer
360
views
Where to change PATH in Kubuntu?
What is the correct location to add to my PATH so that it is used across all applications? Currently, my PATH is set in my .zshrc file. However, this prevents GVIM from seeing that path, and prevents ...
0
votes
0
answers
158
views
environment variable PATH changes inside script command
I usually tend to keep a log of certain sessions using the useful script command. But, I observed that behaviour seems to change upon using it. To be precise,
before using script, the location of ...
1
vote
0
answers
101
views
Need to set currency from environment file
Should I use doller sign for currency in all site from env?
Is it good practice to use it from env?
3
votes
2
answers
1k
views
Should I be using a different strategy than "SetEnv" for setting apache environment vars on 18.04?
I'm using Ubuntu 18.04, apache 2 and Python 3.6. In my Python project settings file, I have
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ['...
9
votes
1
answer
9k
views
Multiple EnvironmentFile(s) for systemd service file
I'm using Celery alongside Django, and because I'm running into This Problem (Gunicorn not having access to OS environment variables) I've had to set EnvironmentFile=/etc/environment within my ...
1
vote
1
answer
2k
views
Set global environment variables from a custom file
I am trying to execute a file containing environment variables so that whenever I log in, those variables are immediately accessible.
The $PATH variable is defined in /etc/environment so underneath ...
0
votes
2
answers
1k
views
Obtain an environment variable over the network from another computer
I have a myuserid@remotemachine on my network to which I have access via public/private key ssh (ie, doesn't prompt for password, logs me straight in). Is there a way, from Python (or bash, or any ...
0
votes
1
answer
2k
views
Using environment variables with Node.js
I am trying to prepare my app for production on a ubuntu running nginx. I have been using the dotenv npm package during development, but need a more stable and secure method for production. I have ...
1
vote
1
answer
2k
views
I have to add add PATH to /etc/environment but it breaks my machine - why?
I'm trying to work with tensorflow on Ubuntu 18.04 using Deep Learning AMI from Amazon which has all CUDA verions installed. However, it's not so easy to make tensorflow 1.X work with GPU because some ...
0
votes
0
answers
2k
views
how to change /etc/environment from bash
So I messed up. I was experimenting with path environment, and I accidentally edited the /etc/environemnt and added PATH=$PATH:$JAVA_HOME/bin and now I stucked on login loop.
I tried to fix my ...
3
votes
1
answer
4k
views
WSL Ubuntu 18.04 : where is $PATH modified at startup?
In summary, there are entries in my $PATH that i don't know where they are added. Help!
My general question is: At which places is my $PATH variable modified when starting up a terminal?
My specific ...
-1
votes
1
answer
60
views
My System is failed to unlocked
I mistakenly change my variable path of my xubuntu 18.04, i have tried many options found in this platform but is not working for me.
Please i need an urgent help Screenshotof my tty4 console
1
vote
1
answer
802
views
how to suppress ld.so.preload error messages in gnome-terminal when I launch it
I built a 32 bit shared object and added its path to /etc/ld.so.preload to preload it system wide. It works well and all the applications in my system use it. But whenever I launch gnome-terminal I ...
0
votes
1
answer
1k
views
Java JNI call FindClass fails from a C++ program
I am trying to follow this tutorial which calls a Java class from a C++ program. A Java virtual machine is instantiated but the call to FindClass fails. The code sample is directly from the tutorial:
...
1
vote
1
answer
952
views
How to link a c++ program to jvm (java virtual machine)?
I am trying to follow this tutorial which creates a JVM from a c++ program. The program compiles but when it runs it fails with
error while loading shared libraries: libjvm.so: cannot open shared ...
0
votes
0
answers
2k
views
How to add to /etc/environment?
I use a mac at work, which has /etc/paths to add paths, with the syntax:
/usr/foo
/usr/bar
Using wsl with ubuntu-18.04-ls, I wanted to add "/home/linuxbrew/.linuxbrew/bin" to etc/environment, ...
0
votes
1
answer
282
views
why is my output not correct while dividing by a variable in awk?
I wrote a small watch script to monitor the load average on a Linux server (just for learning purposes but watch uptime wasn't giving the output I want).
It works well, but to get the load average for ...