How to Install Maven on Ubuntu 22.04

Maven is a well-known project management tool and build automation utilized primarily in Java-based projects. It offers a comprehensive and consistent way to manage, build and organize software projects. This tool was deployed by the Apache Software Foundation. Additionally, it has also influenced other build tools and project management systems in this modern software industry.

Therefore, today’s tutorial will be showing the procedure for installing and removing Maven on Ubuntu 22.04.

How to Install Maven on Ubuntu 22.04 Using apt?

apt” enables Ubuntu users to manage, install, and delete pancakes on their system easily. So, in this section, we will make use of apt for installing Maven on Ubuntu 22.04.

Step 1: Launch Terminal

As the first step, press “CTRL+ALT+T” to launch the Ubuntu default terminal:

Step 2: Update the Packages List

Next, update the packages list using the command we have mentioned below:

sudo apt update

Step 3: Install Maven

After that, use this command to install Maven on your Ubuntu 22.04:

sudo apt install maven -y

Consequently, Maven has been installed successfully on Ubuntu 22.04.

How to Verify Maven Installation on Ubuntu 22.04?

Once Maven has been installed on Ubuntu 22.04, you can verify its installation by utilizing the mentioned command:

mvn --version

Now, Maven version 3.6.3 is installed on our Ubuntu 22.04.

How to Remove/Uninstall Maven on Ubuntu 22.04?

If case if Maven is no longer required, uninstall it by following the provided instructions.

Step 1: Uninstall Maven

First of all, type the command below in the opened terminal:

sudo apt remove maven -y

Step 2: Verify Maven Uninstallation

Then, utilize the mentioned command for verifying whether Maven is uninstalled or not:

mvn --version

That was all from this guide.


For installing Maven on Ubuntu 22.04, launch the terminal. Then, update the packages list by using the “sudo apt update”. Now, utilize the “sudo apt install maven -y” command to install Maven. You can verify its installation by verifying the version number.

To do so, run the “mvn –version” command in the terminal. Moreover, you can uninstall Maven from your Ubuntu 22.04 by executing the “sudo apt remove maven -y” command. That’s how you can install and uninstall Maven on Ubuntu 22.04.

Print Friendly, PDF & Email