Server Fault is a question and answer site for system and network administrators. 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

To install Maven, I downloaded the latest version from the website and then followed these steps:

The last step, the version control, does not work. It says that 'mvn' is currently not installed and that I should type sudo apt-get install maven2

If I go directly to the mvn file itself, it does work:

root@ubuntu:~# /usr/local/apache-maven/apache-maven-2.2.1/bin/mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_21
Java home: /usr/java/jdk1.6.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-25-generic" arch: "i386" Family: "unix"

So, what am I doing wrong here? Or what would and apt-get install do extra that I might have forgotten?

share|improve this question

Add the manually installed maven binary-directory to your PATH-environment

export PATH=${PATH}:/usr/local/apache-maven/apache-maven-2.2.1/bin/
share|improve this answer

Had a similar issue on 11.10, this is how I solved it:

  1. Install Maven2 from Synaptic rather than downloading it from the website.
  2. gedit ~/.bashrc and check if you have M2_HOME and M2 env variables defined if so DELETE them, delete them from PATH too, if there is a reference to them.
  3. Reload bash and trymvn --version again.
share|improve this answer

possibly its not in your path the program mvn?

or if mvn is referring to a package maybe ubuntu doesn't know about your tar non deb install?

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.