Not able to 'unset' environmental variable permanently - UBUNTU
up vote
3
down vote
favorite
I set environment variable using export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 before some time from the terminal.
But now i want to unset this variable premenantly.
I use unset CATALINA_HOME to remove that variable but when I open other terminal that variable is available with the same value.
How can I remove the 'env variable' permanently ?
Thanks in advance.
14.04 environment-variables
add a comment |
up vote
3
down vote
favorite
I set environment variable using export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 before some time from the terminal.
But now i want to unset this variable premenantly.
I use unset CATALINA_HOME to remove that variable but when I open other terminal that variable is available with the same value.
How can I remove the 'env variable' permanently ?
Thanks in advance.
14.04 environment-variables
1
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
In my home directory I found.bashrcfile and lineexport CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56at the end of the file. So I remove that line ?
– ckpatel
May 17 '15 at 16:32
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I set environment variable using export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 before some time from the terminal.
But now i want to unset this variable premenantly.
I use unset CATALINA_HOME to remove that variable but when I open other terminal that variable is available with the same value.
How can I remove the 'env variable' permanently ?
Thanks in advance.
14.04 environment-variables
I set environment variable using export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 before some time from the terminal.
But now i want to unset this variable premenantly.
I use unset CATALINA_HOME to remove that variable but when I open other terminal that variable is available with the same value.
How can I remove the 'env variable' permanently ?
Thanks in advance.
14.04 environment-variables
14.04 environment-variables
edited May 17 '15 at 16:10
Thomas Ward♦
42.9k23119169
42.9k23119169
asked May 17 '15 at 16:08
ckpatel
12114
12114
1
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
In my home directory I found.bashrcfile and lineexport CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56at the end of the file. So I remove that line ?
– ckpatel
May 17 '15 at 16:32
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55
add a comment |
1
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
In my home directory I found.bashrcfile and lineexport CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56at the end of the file. So I remove that line ?
– ckpatel
May 17 '15 at 16:32
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55
1
1
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
In my home directory I found
.bashrc file and line export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 at the end of the file. So I remove that line ?– ckpatel
May 17 '15 at 16:32
In my home directory I found
.bashrc file and line export CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56 at the end of the file. So I remove that line ?– ckpatel
May 17 '15 at 16:32
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55
add a comment |
3 Answers
3
active
oldest
votes
up vote
6
down vote
accepted
The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles.
Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present:
/etc/environment/etc/profile~/.profile~/.bashrc
Once removing the line from the file, log out, and log back in (if in a terminal, just close the terminal and reopen it). If it was in /etc/environment then consider rebooting the system first.
With the export line gone, the variable will be 'permanently unset' until the line is readded to one of those files.
1
In my case I had to comment outexport varin/etc/profile.
– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which setsJAVA_HOME. You might need your own question for this one, though.
– Thomas Ward♦
Apr 6 at 13:26
add a comment |
up vote
0
down vote
Just to supplement the existing good answer, here's a simple line to help you to find the file you need to edit, based on this answer:
egrep -lir "export variable" /etc/environment /etc/profile ~/.profile ~/.bashrc
The word enclosed in quotes is the name of the environment variable it will search for.
It will provide you with the filename, then you just need to find the corresponding exprot line and comment or delete it.
add a comment |
up vote
0
down vote
add unset CATALINA_HOME to the shell file (.bashrc or .zshrc)
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles.
Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present:
/etc/environment/etc/profile~/.profile~/.bashrc
Once removing the line from the file, log out, and log back in (if in a terminal, just close the terminal and reopen it). If it was in /etc/environment then consider rebooting the system first.
With the export line gone, the variable will be 'permanently unset' until the line is readded to one of those files.
1
In my case I had to comment outexport varin/etc/profile.
– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which setsJAVA_HOME. You might need your own question for this one, though.
– Thomas Ward♦
Apr 6 at 13:26
add a comment |
up vote
6
down vote
accepted
The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles.
Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present:
/etc/environment/etc/profile~/.profile~/.bashrc
Once removing the line from the file, log out, and log back in (if in a terminal, just close the terminal and reopen it). If it was in /etc/environment then consider rebooting the system first.
With the export line gone, the variable will be 'permanently unset' until the line is readded to one of those files.
1
In my case I had to comment outexport varin/etc/profile.
– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which setsJAVA_HOME. You might need your own question for this one, though.
– Thomas Ward♦
Apr 6 at 13:26
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles.
Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present:
/etc/environment/etc/profile~/.profile~/.bashrc
Once removing the line from the file, log out, and log back in (if in a terminal, just close the terminal and reopen it). If it was in /etc/environment then consider rebooting the system first.
With the export line gone, the variable will be 'permanently unset' until the line is readded to one of those files.
The environment variable is always going to be set if it's present in your configuration files for your system's environment variables or your own login profiles.
Open each of these files and search for a line that has export CATALINA_HOME, and remove the line where present:
/etc/environment/etc/profile~/.profile~/.bashrc
Once removing the line from the file, log out, and log back in (if in a terminal, just close the terminal and reopen it). If it was in /etc/environment then consider rebooting the system first.
With the export line gone, the variable will be 'permanently unset' until the line is readded to one of those files.
edited Jan 30 at 19:37
answered May 17 '15 at 17:49
Thomas Ward♦
42.9k23119169
42.9k23119169
1
In my case I had to comment outexport varin/etc/profile.
– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which setsJAVA_HOME. You might need your own question for this one, though.
– Thomas Ward♦
Apr 6 at 13:26
add a comment |
1
In my case I had to comment outexport varin/etc/profile.
– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which setsJAVA_HOME. You might need your own question for this one, though.
– Thomas Ward♦
Apr 6 at 13:26
1
1
In my case I had to comment out
export var in /etc/profile.– Rishabh Agrahari
Jul 15 '17 at 3:46
In my case I had to comment out
export var in /etc/profile.– Rishabh Agrahari
Jul 15 '17 at 3:46
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
JAVA_HOME is in none of these, yet set when I launch a terminal...
– Xerus
Apr 5 at 23:43
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which sets
JAVA_HOME. You might need your own question for this one, though.– Thomas Ward♦
Apr 6 at 13:26
@Xerus Sounds like there might be something else called from one of these (check all the included filepaths inside each of these too) which sets
JAVA_HOME. You might need your own question for this one, though.– Thomas Ward♦
Apr 6 at 13:26
add a comment |
up vote
0
down vote
Just to supplement the existing good answer, here's a simple line to help you to find the file you need to edit, based on this answer:
egrep -lir "export variable" /etc/environment /etc/profile ~/.profile ~/.bashrc
The word enclosed in quotes is the name of the environment variable it will search for.
It will provide you with the filename, then you just need to find the corresponding exprot line and comment or delete it.
add a comment |
up vote
0
down vote
Just to supplement the existing good answer, here's a simple line to help you to find the file you need to edit, based on this answer:
egrep -lir "export variable" /etc/environment /etc/profile ~/.profile ~/.bashrc
The word enclosed in quotes is the name of the environment variable it will search for.
It will provide you with the filename, then you just need to find the corresponding exprot line and comment or delete it.
add a comment |
up vote
0
down vote
up vote
0
down vote
Just to supplement the existing good answer, here's a simple line to help you to find the file you need to edit, based on this answer:
egrep -lir "export variable" /etc/environment /etc/profile ~/.profile ~/.bashrc
The word enclosed in quotes is the name of the environment variable it will search for.
It will provide you with the filename, then you just need to find the corresponding exprot line and comment or delete it.
Just to supplement the existing good answer, here's a simple line to help you to find the file you need to edit, based on this answer:
egrep -lir "export variable" /etc/environment /etc/profile ~/.profile ~/.bashrc
The word enclosed in quotes is the name of the environment variable it will search for.
It will provide you with the filename, then you just need to find the corresponding exprot line and comment or delete it.
answered Apr 5 at 23:43
Xerus
1034
1034
add a comment |
add a comment |
up vote
0
down vote
add unset CATALINA_HOME to the shell file (.bashrc or .zshrc)
add a comment |
up vote
0
down vote
add unset CATALINA_HOME to the shell file (.bashrc or .zshrc)
add a comment |
up vote
0
down vote
up vote
0
down vote
add unset CATALINA_HOME to the shell file (.bashrc or .zshrc)
add unset CATALINA_HOME to the shell file (.bashrc or .zshrc)
edited Nov 20 at 13:08
abu_bua
3,05281023
3,05281023
answered Nov 19 at 18:14
d27saurabh
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f624914%2fnot-able-to-unset-environmental-variable-permanently-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
First you have to figure out where you set that variable in the first place. Do you know where you set it before? Simply setting it in the terminal is not enough to make a 'permanent' env variable
– Thomas Ward♦
May 17 '15 at 16:09
No I don't know where that variable is set at first time.
– ckpatel
May 17 '15 at 16:14
In my home directory I found
.bashrcfile and lineexport CATALINA_HOME=/home/chirag/Softwares/apache-tomcat-7.0.56at the end of the file. So I remove that line ?– ckpatel
May 17 '15 at 16:32
Thanks, I remove line containing CATALINA_HOME variable and it works.
– ckpatel
May 17 '15 at 16:48
Glad to hear it! I've moved my comments into an answer so you can accept it as the valid answer and mark the question as 'solved'.
– Thomas Ward♦
May 17 '15 at 17:55