Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Immutable Page
  • Info
  • Attachments

Revision 1 as of 16/09/2006 15.18.34

Clear message

BR

Cosa sono i repository

Ci sono migliaia di programmi installabili in Ubuntu. Questi programmi si trovano in alcuni archivi software (i repository) e sono disponibili per l'installazione attraverso internet. Questo rende l'installazione di nuovi programmi estremamente facile e molto sicura, dato che ogni programma che si installa viene controllato e creato specificamente per Ubuntu.

I repository di Ubuntu sono organizzati in quattro "[:Repository/Componenti:componenti]" sulla base del livello di supporto fornito al software e da quanto il software sia aderente alla [http://www.ubuntu-it.org/index.php?page=Filosofia filosofia di Ubuntu]. Questi componenti sono chiamati Main (software supportato ufficialmente), Restricted (software supportato ma non disponibile nei termini del software libero), Universe (mantenuto dalla comunità, non ufficialmente supportato), Multiverse (software non libero).

Il CD di installazione di Ubuntu contiene software preso dai componenti Main e Restricted. Una volta che il sistema avrà stabilito una connessione a internet, molti software saranno disponibili per l'installazione. Utilizzando il gestore di pacchetti sarà possibile eseguire delle ricerche, installare e aggiornare qualsiasi applicazione direttamente da internet, senza bisogno del CD.

Gestire i repository dalla riga di comando

Questa pagina descrive come gestire i repository dalla riga di comando. Questo può essere utilie se non si riesce o non si vuole utilizzare un'interfaccia grafica. Queste informazioni si rivelano utili dato che funzionano in tutte le versioni di Ubuntu.

Le istruzioni contenute in questa pagina assumono una buona conoscenza dell'utilizzo di editor di testo come gedit o [:Nano:nano]. Se si preferisce utilizzare un'interfaccia grafica consultare [:Repository/Gestire i repository con Ubuntu] o [:Repository/Kubuntu:Gestire i repository con Kubuntu].

Informazioni preliminari

Ubuntu utilizza [http://www.debian.org/doc/user-manuals#apt-howto apt] per la gestione dei paccheti. La lista dei repository, o canali software, è mantenuta nel file:

/etc/apt/sources.list

Modificando questo file dalla riga di comando è possibile aggiungere, rimuovere o disabilitare temporaneamente i repository.

Immagine(Icone/Piccole/note.png,,left) BR È sempre utile fare una copia di riserva di questo file prima di modificarlo. Per fare ciò, digitare il seguente comando:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Il contenuto del file /etc/apt/sources.list è simile a questo:

## sources.list
## General comments about the sources.list file
 deb http://archive.ubuntu.com/ubuntu dapper main restricted
 deb-src http://archive.ubuntu.com/ubuntu dapper main restricted
 
## Comment about the 'Update' repositories
## Comments about the role of the updates
 deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted
 deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted
 
## Comment on the 'Universe' repositories
## Comment about the support limitations of Universe & Multiverse
## repositories as well as licence restrictions and update policies.
## Please satisfy yourself as to your rights to use the software.
# deb http://archive.ubuntu.com/ubuntu dapper universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu dapper universe multiverse

## Comment on the 'Backports' repository
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Comment about update and security update limitations
# deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse 
# deb http://security.ubuntu.com/ubuntu breezy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

Descrizione del file sources.list

  • Tutte le righe che iniziano con uno o due caratteri hash (#) sono commenti e non vengono lette da apt o da tutti gli altri programmi di gestione dei pacchetti.
  • Le linee senza i caratteri hash sono le righe dei repository. Le prime due righe nell'esempio sono:

    deb http://archive.ubuntu.com/ubuntu dapper main restricted
    deb-src http://archive.ubuntu.com/ubuntu dapper main restricted
  • Questo è qeullo che indicano:
    • o
      • deb: These repositories contain binaries or precompiled packages. These repositories are required for most users.
      o
      • deb-src: These repositories contain the source code of the packages. Useful for developers.
      o
      • [WWW] http://archive.ubuntu.com/ubuntu: The URI (Uniform Resource Identifier), in this case a location on the internet. See this page for other repository locations.

      o
      • dapper is the release name or version of your distribution.
      o
      • main & restricted are the section names or components. There can be several section names, separated by spaces.

Aggiungere i repository Universe e Multiverse

Additional software repositories such as Universe and Multiverse can be enabled by uncommenting the corresponding apt line (i.e. delete the '#' at the beginning of the line). In our example, we would uncomment the following lines:

eyes.png If you want to enable only Universe but not Multiverse, delete the word 'multiverse' from the line.

Once you are satisfied with your choices, save the file. Now, retrieve the updated package lists from the newly added repositories by issuing the following command:

    • sudo apt-get update

Done! Your system is ready to install packages from the Universe and Multiverse repositories.

Aggiungere altri repository

warning.png Note: There are some (but not many) good reasons for which you might want to add non-Ubuntu repositories to your list of software sources. Some software cannot be distributed by Ubuntu due to patent and licensing restrictions in some countries (see the RestrictedFormats page for examples). You might want to add repositories that offer such software. Make sure that all repositories you add in this way have been tested and are known to work on Ubuntu systems. Repositories that are not designed to work with your version of Ubuntu can introduce inconsistencies in your system and might force you to re-install.

    • You can add custom software repositories by adding the apt repository line of your software source to the list of repositories. It should look somehting like this:

      deb http://mirror3.ubuntulinux.nl/ dapper-seveas freenx

    • Add the line at the end of your sources.list and save the file.
    • Next, make apt aware of the new software repositories by issuing the following command: sudo apt-get update
    • Done! The new software repositories should now be available for use.

Abilitare repository con uno script (non interattivo)

eyes.png This section is directed at advanced users.

Problem: You are looking for a way to enable the extra repositories without any user input. Example: You are creating a custom install script for an application that needs software packages from the Universe or Multiverse repositories. What follows is a simple script that enables the extra repositories that are commented out on a default install of Ubuntu 6.06 LTS.

    • First, save your original sources.list file. sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
    • Now make the changes to uncomment all respositories listed in the sources.list file. sudo sed -i -e "s/# deb/deb/g" /etc/apt/sources.list
    • Make apt aware of the new software repositories by issuing the following command: sudo apt-get update
    • Done! The new software repositories should now be available for use.

Suggerimenti e raccomandazioni

    • It is always a good idea to back up configuration files like /etc/apt/sources.list before you begin editing. You can then revert your changes if needed. If things go badly wrong, head over to [WWW] http://www.ubuntulinux.nl/source-o-matic and let the script create a new sources.list file for you.

    • If you decide to add other repositories to sources.list, make sure that the repository is meant to work (and known to work) with Ubuntu. Repositories that are not designed to work with your version of Ubuntu can introduce inconsistencies in your system and might force you to re-install. Also, make sure that you really need to add external repositories as the software package(s) you are looking for may already have been introduced into the official repositories!
    • Please keep in mind that it may not be legal to enable some non-Ubuntu software repositories in some countries.
    • You may be asked enter a security key when adding a non-Ubuntu repository to your sources. See Managing Authentication Keys for instructions.
    • Remember to retrieve updated package lists by issuing a sudo apt-get update when you're done editing sources.list.

Link utili


CategoryInTraduzione