Home > OS >  Ubuntu18.04 server environment variables each boot should be submitted once
Ubuntu18.04 server environment variables each boot should be submitted once

Time:10-18

Inside the virtual machine ubuntu18, install the JDK and hadoop, in/etc/configure the environment variables JAVA_HOME and HADOOP_HOME enviroment, but each time after startup must perform a source/etc/enviroment to use, otherwise prompt can not find, how to solve

CodePudding user response:

Don't have time to pack a validation, give some ideas:
1,/etc/enviroment by pam_env effect, so check the/etc/PAM. D/the comm - * file, see if there are any reference pam_env. So
2, the global environment variables can also be in the/etc/profile and/etc/profile. D/set in the
3, start the Hadoop environment variable is not must be global, so start users ~/. Following Settings can also be there
4, don't even need to environment variables, in front of the startup scripts also can set the variable, and complete the startup scripts usually contains configuration files, the key you will see...

CodePudding user response:

reference 1st floor sazhufa response:
don't have time to pack a validation, give some ideas:
1,/etc/enviroment by pam_env effect, so check the/etc/PAM. D/the comm - * file, see if there are any reference pam_env. So
2, the global environment variables can also be in the/etc/profile and/etc/profile. D/set in the
3, start the Hadoop environment variable is not must be global, so start users ~/. Following Settings can also be there
4, don't even need to environment variables, in front of the startup scripts also can set the variable, and complete the startup scripts usually contains configuration files, the key you will see...

On the system, the echo $PATH, environment variables will be a snap/bin, submit will disappear after the envirment, if I do this in the source/etc/profile,/snap/bin will come out

Profile is a list of the if the script, the snap/bin under nothing

Should be a snap/bin this directory, not easy to see now

CodePudding user response:

refer to the second floor the frog angry reply:
Quote: refer to 1st floor sazhufa response:
don't have time to pack a validation, give some ideas:
1,/etc/enviroment by pam_env effect, so check the/etc/PAM. D/the comm - * file, see if there are any reference pam_env. So
2, the global environment variables can also be in the/etc/profile and/etc/profile. D/set in the
3, start the Hadoop environment variable is not must be global, so start users ~/. Following Settings can also be there
4, don't even need to environment variables, in front of the startup scripts also can set the variable, and complete the startup scripts usually contains configuration files, the key you will see...

On the system, the echo $PATH, environment variables will be a snap/bin, submit will disappear after the envirment, if I do this in the source/etc/profile,/snap/bin will come out

Profile is a list of the if the script, the snap/bin under nothing

This directory should be/snap/bin, now is not convenient to see


To the PATH for? Environment variables can be any thing, the PATH is, JAVA_HOME, any other legal variable names can be...

CodePudding user response:

Is added in/etc/profile, if specified users only need to be in/home/{}/bashrc china-canada,
Can be added to the last line directly,
  • Related