Ubuntu – Unable to remove maven using ‘sudo apt-get remove maven2’

aptmaven-3

I want to upgrade to newer version of maven. For that i first want to remove the existing version of maven in the computer as told here. I tried sudo apt-get remove maven2. But it is saying

sanchit@sanchit-3560:/usr/share$ sudo apt-get remove maven2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'maven2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

Then i typed mvn-version just to make sure that maven is not present. But to my surprise i found

sanchit@sanchit-3560:/usr/share$ mvn -version
The program 'mvn' can be found in the following packages:
* maven
* maven2

Unsure of what to do next i did locate maven and deleted everything that was present in /usr/share/maven-repo . But after this also if i type mvn-version it is showing the output what is was showing above.

How can i automatically remove maven ?

Best Answer

Actually it shows that you already removed it. You can go ahead and use sudo apt-get install maven