Unable to locate package maven

I am trying to install maven with the command sudo apt-get install maven, but I keep on getting this error

E: unable to locate package maven

I have been googling and tried updating, upgrading, and few other things but nothing seems to work. Any help will be appreciated.


Solution 1:

maven is in the Universe repositories:

sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install maven