come installare ANT in Ubuntu 14.04


13

Sono nuovo di Ubuntu e sto cercando di installare Apache ANT in Ubuntu

Ho scaricato il pacchetto (apache-ant-1.9.4-bin.tar.gz) e in un terminale ho dato un comando come questo

sudo apt-get install apache-ant-1.9.4-bin.tar.gz

Ho questi due errori

E: Unable to locate package apache-ant-1.9.4-bin.tar.gz
E: Couldn't find any package by regex 'apache-ant-1.9.4-bin.tar.gz'

e se uso

/etc/apt/sources.list

1   deb-src http://ppa.launchpad.net/klaus-vormweg/bluefish/ubuntu trusty main$
 2  sudo apt-get install python-software-properties$
 3  # deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted$
 4  $
 5  # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to$
 6  # newer versions of the distribution.$
 7  $
 8  ## Major bug fix updates produced after the final release of the$
 9  ## distribution.$
10  $
11  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu$
12  ## team. Also, please note that software in universe WILL NOT receive any$
13  ## review or updates from the Ubuntu security team.$
14  $
15  ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu $
16  ## team, and may not be under a free licence. Please satisfy yourself as to $
17  ## your rights to use the software. Also, please note that software in $
18  ## multiverse WILL NOT receive any review or updates from the Ubuntu$
19  ## security team.$
20  $
21  ## N.B. software from this repository may not have been tested as$
22  ## extensively as that contained in the main release, although it includes$
23  ## newer versions of some applications which may provide useful features.$
24  ## Also, please note that software in backports WILL NOT receive any review$
25  ## or updates from the Ubuntu security team.$
26  $
27  $
28  ## Uncomment the following two lines to add software from Canonical's$
29  ## 'partner' repository.$
30  ## This software is not part of Ubuntu, but is offered by Canonical and the$
31  ## respective vendors as a service to Ubuntu users.$
32  deb http://archive.canonical.com/ubuntu trusty partner$
33  deb-src http://archive.canonical.com/ubuntu trusty partner$
34  $
35   This software is not part of Ubuntu, but is offered by third-party$
36  developers who want to ship their latest software.$
37  deb http://extras.ubuntu.com/ubuntu trusty main$
38  deb-src http://extras.ubuntu.com/ubuntu trusty main$
39  deb http://archive.ubuntu.com/ubuntu trusty universe main multiverse restricted$
40  deb-src http://archive.ubuntu.com/ubuntu trusty universe main restricted multiverse #Added by software-properties$
41  deb http://security.ubuntu.com/ubuntu/ trusty-security universe main multiverse restricted$
42  deb http://archive.ubuntu.com/ubuntu trusty-updates universe main multiverse restricted$
43  deb http://archive.ubuntu.com/ubuntu trusty-proposed universe main multiverse restricted$
44  deb http://archive.ubuntu.com/ubuntu trusty-backports universe main multiverse restricted$

Come devo procedere?


Non è possibile installare un archivio .tar.gz con apt-get. Apt-get installa i pacchetti dal repository dei pacchetti.
— user205301

ok allora come posso installare Apache ANT in Ubuntu altri passaggi
— Vinodh Kumar

Pubblica il contenuto di /etc/apt/sources.list. Si è verificato un errore nella riga 2.
— AB

Acquista i passi completi e chiari qui stackoverflow.com/a/51780186/3089950
— Irshad

Risposte:


15

Il file apache-ant-1.9.4-bin.tar.gznon è un pacchetto installabile. Un pacchetto installabile termina con .deb.

È possibile installare la formica tramite il gestore pacchetti.

Ma prima devi correggere un bug nel tuo sistema:

Apri un terminale ed esegui questo comando

sudo nano /etc/apt/sources.list

Rimuovi la linea (linea 2)

sudo apt-get install python-software-properties$

e nelle righe 35 e 36 aggiungere #a all'inizio della riga:

# This software is not part of Ubuntu, but is offered by third-party
# developers who want to ship their latest software.

e rimuovi tutto $dal tuosources.list

Quindi eseguire il comando:

sudo apt-get update

Quindi installa la formica :

sudo apt-get install ant

1
È un po 'fuorviante affermare che .tar.gz normalmente contiene il codice sorgente poiché quasi tutte le versioni binarie generiche per Linux sono anche archivi .tar.gz proprio come in questo caso.
— user205301

Grazie AB Funziona bene .... problema risolto. grazie mille
— Vinodh Kumar,

@ user205301 OK, rimosso
— AB

@VinodhKumar Sei stato soddisfatto della mia risposta? Allora dammi un voto (∧). Se potessi risolvere il tuo problema, sarebbe bello se tu segnassi la mia risposta (✓). ;)
— AB

Non ho potuto votare la tua risposta. perché ha bisogno di 35 reputazioni, ho accettato la tua risposta è giusta.
— Vinodh Kumar,

9

Semplicemente: sudo apt-get install ant

Se hai bisogno di una versione più recente, devi estrarre il .tar.gz che hai scaricato da qualche parte ed eseguire la formica da lì.

tar xzvf apache-ant-1.9.4-bin.tar.gzestrae l'archivio. Fondamentalmente è solo un archivio ZIP. Puoi estrarlo anche graficamente dal browser dei file.


ho provato questo comando 'sudo apt-get install ant' ma ho
— riscontrato

Prova a correre per sudo apt-get updateprimo. Ho Ubuntu 14.04 e ho appena installato la formica con apt-get, quindi il pacchetto dovrebbe essere lì.
— user205301

ho provato sudo apt-get update ho riscontrato questo errore E: il tipo 'sudo' non è noto alla riga 2 nell'elenco delle fonti /etc/apt/sources.list E: l'elenco delle fonti non è stato letto.
— Vinodh Kumar,

Come può eseguire il comando in sudo apt-get updatecaso di errore? Leggi la domanda.
— AB

@AB Ho aggiunto la riga di errore di sources.list nelle
— domande..controllalo
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.