如何将Maven安装到Red Hat Enterprise Linux 6中? [英] How to install Maven into Red Hat Enterprise Linux 6?
问题描述
我正在使用Scientific Linux机器,正在尝试使用yum
命令安装Maven.不认识您的Scientific Linux是基于Red Hat Linux Enterprise Edition 6的.
I'm working on a Scientific Linux box and am trying to install Maven using the yum
command. Scientific Linux for those of you who do not know is based off of Red Hat Linux Enterprise Edition 6.
我更喜欢以一种易于更新的方式安装Maven,这就是为什么我不仅仅去Apache Maven站点并获取我需要的文件.
仅凭root特权运行yum
是不够的.我使用了yum search maven
,它返回了"JPackage Utilities",但我尝试安装它只是为了获得:
I'd prefer to install Maven in a way that lent itself to easy updating, that is why I have shied away from simply going to the Apache Maven site and getting the files I need.
Simply running yum
with root privileges was not enough. I used yum search maven
which returned "JPackage Utilities", which I tried to install only to get:
Package jpackage-utils-1.7.5-3.12.el6.noarch already installed and latest version
我假设像创建一个新的repo文件之类的东西会像/etc/yum.repos.d/maven.repo
这样的方法.
我找到一个网站,建议将我的maven.repo文件指向URL http://www.jpackage.org/jpackage50.repo ,但这似乎是对较旧版本的Linux的修复,因为它无法解决我的问题
I was assuming that something like creating a new repo file something like /etc/yum.repos.d/maven.repo
would do the trick.
I found a site suggesting that I point my maven.repo file to the URL http://www.jpackage.org/jpackage50.repo, however this seems to be a fix for an older version of Linux as it did not solve my problem
一如既往,感谢您的帮助或建议!
As always thanks in advance for any help or suggestions!
推荐答案
您需要的是与发行版不可知的通用存储库.作为根用户,将几个jpackage通用存储库添加到yum(下面的两个代码段).然后执行yum更新,最后yum安装maven2.
The distro agnostic generic repo is what you want. As root, add a couple of the jpackage-generic repos to yum (two snippets below). Then perform a yum update and finally yum install maven2.
cat > /etc/yum.repos.d/jpackage-generic-free.repo << EOF
[jpackage-generic-free]
name=JPackage generic free
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/free/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF
cat > /etc/yum.repos.d/jpackage-generic-devel.repo << EOF
[jpackage-generic-devel]
name=JPackage Generic Developer
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/devel/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF
这篇关于如何将Maven安装到Red Hat Enterprise Linux 6中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!