如何使用apt-get在Ubuntu 17.04 / 16.10 / 16.04 LTS / 15.10 / 15.04 / 14.10 / 14.04 LTS / 13.10 / 13.04上安装Maven 3? [英] How to install Maven 3 on Ubuntu 17.04/16.10/16.04 LTS/15.10/15.04/14.10/14.04 LTS/13.10/13.04 by using apt-get?

查看:204
本文介绍了如何使用apt-get在Ubuntu 17.04 / 16.10 / 16.04 LTS / 15.10 / 15.04 / 14.10 / 14.04 LTS / 13.10 / 13.04上安装Maven 3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试:

sudo apt-get install maven

如果它适用于你,请忽略这篇文章的其余部分。

If it works for you ignore the rest of this post.

我在2013年4月开始设置我的Ubuntu 12.10,正常的 sudo apt-get install maven 当时没有为maven 3工作。

I started setting up my Ubuntu 12.10 on April 2013 and the normal sudo apt-get install maven was not working for maven 3 back then.

如果您想深入了解关于apt-get的ubuntu内核及其中的内容,本文中的手动安装非常有用找到可在Ubuntu
上安装的应用程序列表。如果您遇到与Ubuntu 12.10相同的问题,它对于最新版本的Ubuntu(如 Ubuntu 15.04 等)也可能有用。

The manual installation in this post is useful if you like to dig in deeper to your ubuntu kernel in regards with apt-get and where it finds the list of applications that are available for installation on Ubuntu . It can also be potentially useful for more recent releases of Ubuntu like Ubuntu 15.04, etc. if you face the same problem as I did back then with Ubuntu 12.10.

如果你的话,请查看手动安装当前的ubuntu无法通过常见的apt-get install maven安装maven。

Checkout the manual installation if your current ubuntu can not install maven via common 'apt-get install maven'.

sudo apt-get update
sudo apt-get install maven

如果您的ubuntu不新鲜或者您是ubuntu,请确保删除maven 2之前使用maven 2:

Make sure to remove maven 2 if your ubuntu is not fresh or if you were using maven 2 before:

sudo apt-get remove maven2



通过添加maven 3存储库(Ubuntu 14.04检查更新1)通过apt-get手动安装:



这个如果您的ubuntu apt-get存储库列表不是最新的,则非常有用。

Manual Installation via apt-get by adding maven 3 repository (Ubuntu 14.04 check out update 1):

This can be useful if your ubuntu apt-get repositories list is not up to date.

Maven 3是设置系统所必需的,因为它证明了大部分文档在那里指的是如何将Maven安装到Ubuntu 12.04或之前版本。我找到的最佳文件是:

Maven 3 was required to set up the system and as it turns out most of the documents out there are referring to how to install Maven to Ubuntu version 12.04 or before. Best document I found was:

killertilapia的博客

我想出的整个过程如下:

The whole process I came up with is as follows:


  1. sudo -H gedit /etc/apt/sources.list

  2. sources.list 文件中添加以下行:

  1. sudo -H gedit /etc/apt/sources.list
  2. Add the following line the sources.list file:


deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu 精确主要

deb-src http:// ppa。 launchpad.net/natecarlson/maven3/ubuntu 精确主要

deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main


  • sudo apt-得到更新&& sudo apt-get install maven3




    警告1:命令sudo apt-add -repository ppa:natecarlson / maven3在我的Ubuntu上无效,必须运行 sudo apt-add-repository -rm ppa:natecarlson / maven3 才能获得我的apt-get再次工作。

    Caution 1: command "sudo apt-add-repository ppa:natecarlson/maven3" did not work on my Ubuntu and had to run sudo apt-add-repository -rm ppa:natecarlson/maven3 to get my apt-get to work again.

    警告2:感谢David,您需要在运行第4步之前删除以前版本maven的现有符号链接。

    Caution 2: thanks to David, you need to remove your existing symbolic link to previous versions of maven before running step 4.



    OS X安装



    我决定添加OS X安装,以防你使用多个环境dev:有关详细信息,请参阅源stackoverflow线程

    安装等于 apt-get的 Homebrew ,然后使用以下方法安装Maven:

    Install Homebrew that is the equavalent of apt-get, then install Maven using:

    brew install maven
    



    更新1 Ubunutu 14.04的安装



    我自己没试过,但我相信这应该没有安全警告:

    Update 1: Installation for Ubunutu 14.04

    Haven't tried this myself but I am confident this should work without security warnings:

    sudo apt-get purge maven maven2 maven3
    sudo apt-add-repository ppa:andrei-pozolotin/maven3
    sudo apt-get update
    sudo apt-get install maven3
    

    注意:source 这里,非常感谢@rendybjunior,@ Dominic_Bartl和@ FunThomas424242 + 1s

    Note: source here, many thanks and +1s to @rendybjunior, @Dominic_Bartl, and @FunThomas424242

    推荐答案

    这是一种更简单的方法:

    Here's an easier way:

    sudo apt-get install maven
    

    更多细节在其他地方

    这篇关于如何使用apt-get在Ubuntu 17.04 / 16.10 / 16.04 LTS / 15.10 / 15.04 / 14.10 / 14.04 LTS / 13.10 / 13.04上安装Maven 3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆