Icarus answered a very similar question for me. Its not using "yum", but should still work for your purposes. Try,

Copywget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz

basically just go to the maven site. Find the version of maven you want. The file type and use the mirror for the wget statement above.

Afterwards the process is easy

  1. Run the wget command from the dir you want to extract maven too.
  2. run the following to extract the tar,

    Copytar xvf apache-maven-3.0.5-bin.tar.gz
    
  3. move maven to /usr/local/apache-maven

    Copymv apache-maven-3.0.5  /usr/local/apache-maven
    
  4. Next add the env variables to your ~/.bashrc file

    Copyexport M2_HOME=/usr/local/apache-maven
    export M2=$M2_HOME/bin 
    export PATH=PATH
    
  5. Execute these commands

    source ~/.bashrc

6:. Verify everything is working with the following command

Copy    mvn -version
Answer from OrwellHindenberg on Stack Overflow
🌐
Apache Maven
maven.apache.org › install.html
Installation – Maven
3 days ago - sudo dnf install maven · sudo yum install maven · Installation on Windows is supported by Chocolatey and Scoop. choco install maven ·
Top answer
1 of 10
239

Icarus answered a very similar question for me. Its not using "yum", but should still work for your purposes. Try,

Copywget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz

basically just go to the maven site. Find the version of maven you want. The file type and use the mirror for the wget statement above.

Afterwards the process is easy

  1. Run the wget command from the dir you want to extract maven too.
  2. run the following to extract the tar,

    Copytar xvf apache-maven-3.0.5-bin.tar.gz
    
  3. move maven to /usr/local/apache-maven

    Copymv apache-maven-3.0.5  /usr/local/apache-maven
    
  4. Next add the env variables to your ~/.bashrc file

    Copyexport M2_HOME=/usr/local/apache-maven
    export M2=$M2_HOME/bin 
    export PATH=PATH
    
  5. Execute these commands

    source ~/.bashrc

6:. Verify everything is working with the following command

Copy    mvn -version
2 of 10
124

You can add maven to the yum libraries like this:

Copywget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

Now you can install maven like this:

Copyyum install apache-maven

Once done, maven 3 will be installed and mvn -version will show you which version you've got - I had 3.2.1.

This worked perfectly for me on CentOS 6 with one exception. It installed OpenJDK 1.6 and made it the default Java version, even though I'd already manually installed JDK 8 (possibly because I'd manually installed it). To change it back use alternatives:

Copyalternatives --config java
alternatives --config javac

and choose the correct version.

🌐
GitHub
gist.github.com › sebsto › 19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux · GitHub
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo sudo yum install -y apache-maven mvn --version
🌐
Gluster
gluster.org › yum-install-maven-yes-you-can
Gluster » Yum install maven : Yes you can !
August 21, 2013 - wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo yum install apache-maven
🌐
Virtono
virtono.com › community › tutorial-how-to › how-to-install-apache-maven-on-centos-7
How To Install Apache Maven On CentOS 7 - Virtono Community
June 8, 2023 - We will install the OpenJDK package, which is a free and open-source implementation of the Java Development Kit. Enter the following command in the terminal: sudo yum install java-1.8.0-openjdk-devel ·
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install apache maven on centos 7
How to Install Apache Maven on CentOS 7 {Quickstart} | PhoenixNAP KB
July 31, 2025 - Apache Maven requires the Java Development Kit. This guide uses the OpenJDK software package. 1. In a terminal window, enter the following: sudo yum install java-1.8.0-openjdk-devel ·
Find elsewhere
🌐
Qiita
qiita.com › aws
Install Maven with Yum on Amazon Linux #AWS - Qiita
April 2, 2017 - sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo sudo yum install -y apache-maven mvn --version
🌐
Awswithatiq
awswithatiq.com › how-to-install-apache-maven-on-amazon-linux-2
How to Install Apache Maven on Amazon Linux 2 – AWS with Atiq
December 27, 2021 - sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo · Next, run this command to install Apache Maven · sudo yum install -y apache-maven ·
🌐
Medium
medium.com › @kotid7461 › installing-of-maven-in-linux-server-513c9e6e27d3
installing of maven in Linux server | by KOTESWARARAO 26_2 | Medium
December 1, 2023 - By using maven to create a sample ... enter · Y or n →y · Apt install tree -y · these are the follwing commands:- 1.sudo yum install java ·...
🌐
Apache Maven
maven.apache.org › download.cgi
Download Apache Maven – Maven
Maven is distributed in several formats for your convenience. Simply pick a ready-made binary distribution archive and follow the installation instructions.
🌐
DevOps Cube
devopscube.com › install-maven-guide
How to Install Maven [Step-by-Step Configuration Guide]
March 15, 2025 - yum install java-17-openjdk-devel ... the latest maven package from the official maven repo. Step 1: Go to Maven Downlaods and get the download link of the latest package....
🌐
DigitalOcean
digitalocean.com › community › tutorials › install-maven-linux-ubuntu
Install Apache Maven on Ubuntu with JDK 17, SDKMAN, CI/CD Automation | DigitalOcean
August 26, 2025 - Learn how to install Apache Maven 3.9.9 on Ubuntu with JDK 17. Configure environment variables, automate setup, and boost DevOps workflows.
🌐
Qiita
qiita.com › maven
Mavenをyumからインストール #AmazonLinux - Qiita
April 27, 2015 - sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo sudo yum install -y apache-maven mvn --version
🌐
Edureka Community
edureka.co › community › 61129 › how-do-i-install-maven-on-centos
How do I install Maven on CentOS
December 27, 2019 - Host '172.31.27.232' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'
🌐
Medium
medium.com › @cloudzenix.in2023 › installing-maven-on-linux-step-by-step-guide-be7cdb16347c
Installing Maven on Linux: Step-by-Step Guide | by Cloudzenix In | Medium
January 12, 2024 - Maven uses remote repositories to resolve dependencies that are unavailable in your local repository. The Central Repository that Maven provides is the most often used remote repository. In this blog post, we have discussed how to install Apache Maven on Linux using a step-by-step guide.
🌐
Apache Maven
maven.apache.org › tools › wrapper
Maven Wrapper – Apache Maven Wrapper
September 8, 2025 - The easiest way to set up the Maven Wrapper for a project is to use the Maven Wrapper Plugin with its provided wrapper goal. To add or update all the necessary Maven Wrapper files to your project, execute the following command: ... Previously you instructed users to install a specific version of Apache Maven, put it on the PATH, and then run the mvn command like the following:
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-apache-maven-on-windows-macos-and-linux
Installation of Apache Maven - GeeksforGeeks
Apache Maven is a build automation tool used primarily for Java projects and helps in the management of dependencies, project builds, and documentation of the project. Here we will provide you with step-by-step instructions to install Apache Maven on Windows, macOS, and Linux.
Published   August 4, 2025
🌐
Softchief
softchief.com › home › blog › trending › installing maven using yum on ec2 instance (amazon linux)
Installing Maven using Yum on EC2 instance (Amazon Linux) | Softchief Learn
November 7, 2017 - Following are the set of commands need to be executed sequentially to install maven. sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo