Questa guida non è stata ancora completamente tradotta. Se vuoi contribuire alla sua traduzione contatta il Gruppo Traduzione di Ubuntu-it.

Apt-Get

The apt-get command is a powerful command-line tool, which works with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system.

Being a simple command-line tool, apt-get has numerous advantages over other package management tools available in Ubuntu for server administrators. Some of these advantages include ease of use over simple terminal connections (SSH), and the ability to be used in system administration scripts, which can in turn be automated by the cron scheduling utility.

Alcuni esempi di utilizzo tipico dell'utilità apt-get:

  • Install a Package: Installation of packages using the apt-get tool is quite simple. For example, to install the network scanner nmap, type the following:

    sudo apt-get install nmap
    

  • Remove a Package: Removal of a package (or packages) is also straightforward. To remove the package installed in the previous example, type the following:

    sudo apt-get remove nmap
    

    Pacchetti multipli: è possibile specificare più di un pacchetto da installare o rimuovere, separati da spazi.

    Also, adding the --purge option to apt-get remove will remove the package configuration files as well. This may or may not be the desired effect, so use with caution.

  • Update the Package Index: The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file and in the /etc/apt/sources.list.d directory. To update the local package index with the latest changes made in the repositories, type the following:

    sudo apt-get update
    

  • Aggiornare i pacchetti: versioni aggiornate dei pacchetti installati possono essere disponibili attraverso i repository dei pacchetti (per esempio per aggiornamenti di sicurezza). Per aggiornare il proprio sistema è necessario, prima di tutto, aggiornare l'indice dei pacchetti come spiegato sopra, quindi digitare:

    sudo apt-get upgrade
    

    Per informazioni sull'avanzamento a un nuovo rilascio di Ubuntu, consultare la Avanzamento di versione.

Le azioni del comando apt-get, come l'installazione o la rimozione di pacchetti, vengono registrate nel file di registro /var/log/dpkg.log.

For further information about the use of APT, read the comprehensive Debian APT User Manual or type:

apt-get help