Aggiungere ppa e sorgenti pacchetti

da terminale

mediante gui

Adding Repositories

Adding the Universe and Multiverse Repositories

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 for the Universe:

  • deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
    deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe
    deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
    deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe

For the Multiverse:

  • deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
    deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse

IconsPage/IconNote.png It is important to add the hardy-updates part of both the universe and the multiverse to ensure you get updates.

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.

Adding Partner Repositories

You can add the partner repositories by uncommenting the following lines in your /etc/apt/sources.list file:

  • deb http://archive.canonical.com/ubuntu hardy partner
    deb-src http://archive.canonical.com/ubuntu hardy partner

Then update as before:

  • sudo apt-get update

    IconsPage/important.png Be aware that the software contained within this repository is NOT open source.

Adding Other Repositories

IconsPage/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 something like this:
    deb http://mirror3.ubuntulinux.nl/ hardy-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.

Adding Launchpad PPA Repositories

Ubuntu 9.10, Karmic Koala, introduces a convenient new command for adding Launchpad PPA (Personal Package Archive) repositories via the command line: add-apt-repository. This command is apparently the same as addrepo available on Debian.

  • The repository is registered with APT and an entry is created in /etc/apt/sources.list and backs up to /etc/apt/sources.list.save (It should probably be creating a file in /etc/apt/sources.list.d folder – this may be the case in the future).
  • If a public key is required and available it is automatically downloaded and registered.
  • You must install python-software-properties first
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:<repository-name>

    Example: sudo add-apt-repository ppa:nhandler

Enabling Repositories with a (non-interactive) Script

IconsPage/IconNote.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 8.04 LTS.

  • First, save your original sources.list file.
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
  • Now make the changes to uncomment all repositories 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.

Problem: You are looking for a way to enable a repository which you provide for users of your software.

  • First, save your original sources.list file.
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
  • Now create a new file ending in ‘sources.list’ in the ‘/etc/apt/sources.list.d’ directory
    echo 'deb http://www.yourdomain.com/packages/ubuntu /' >> /etc/apt/sources.list.d/yourdomain.sources.list
  • Make apt aware of the new software repositories by issuing the following command:
    sudo apt-get update
  • Please be aware that you should sign your packages and ask your users to import your PGP key. Otherwise they will have to confirm that they want to install untrusted packages from your repository.

Suggestions & Recommendations

  • 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 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.

Per approfondimenti:

https://help.ubuntu.com/community/Repositories/CommandLine#head-927a60f6dbb71bf70af641185e9e0a76f5db28a2

Lascia un commento

Effettua il login con uno di questi metodi per inviare il tuo commento:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...