Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to ask newbie question about environment variables in ubuntu

I'm trying to configure maven3 using /etc/environment. I installed maven manually i.e. unpacked, moved to /opt/maven.

My /etc/environment file


When I replace in PATH $MAVEN_HOME with /opt/maven everything works. If I revert changes -> maven is not installed. Why? I check maven after logout/login.

share|improve this question
up vote 3 down vote accepted

/etc/environment is not a shell script. It is read by the pam_env module during log in, and it doesn't do variable expansions, it only accepts KEY=VALUE pairs. You could instead edit /etc/profile (which is a shell script), and add

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.