What's the difference between a PPA and a repository?

I have to disagree with the accepted answer to this question. I would have written the following as a comment to that answer, but it's too lengthy.

  • A repository is a collection of packages, hosted on an arbitrary server.

  • A PPA is also a collection of packages, hosted on the Launchpad servers.

    In particular, a PPA is not a single package, as that very ambiguously formulated point "PPAs are packages (/collections of software)." in the accepted answer may lead to believe. Additionally, a package is not (necessarily) a collection of software, which makes that point even more confusing.

  • Thus, a PPA is a special kind of repository. Like a square is a special kind of rectangle.

The main difference is the hoster. Basically, if you are a programmer and want to develop and distribute your own packages, and you have your own root server in the Internet, you can set up your own repository on it. Great! But what if you don't have a root server, and you don't want to pay for one, but still want to develop and distribute your own packages? Well, then there's Launchpad. It's offering PPAs as a service for exactly that use case. You can basically create your own repository on Launchpad, and manage your own packages there.

Let's have a look at an illustrating example.

  1. First, assume you want to install the MATE Desktop Environment (a Gnome 2 fork) on Ubuntu Saucy Salamander. It is not contained in the official repos, nor do the devs maintain a PPA. Instead, they have their own repo. You could add it like so:

     $ sudo add-apt-repository http://packages.mate-desktop.org/repo/ubuntu
    

    This would result in the following entry being added to /etc/apt/sources.list:

     deb http://packages.mate-desktop.org/repo/ubuntu saucy main
    
  2. Second, assume you also want to have a look at Cinnamon (another Gnome 2 fork). This is contained in the official repos since 13.04, but there's still a PPA maintained by the devs, useful for instance if you're interested in getting new releases quicker. You could add it like so:

     $ sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
    

    This would result in the following entry being added to /etc/apt/sources.list.d/gwendal-lebihan-dev-cinnamon-stable-saucy.list:

     deb http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-stable/ubuntu saucy main
    

    As you can see, the latter entry is quite similar as the one made in point (1). In fact, both are just URLs of repositories from Ubuntu's perspective.

  3. In fact, you could even add the Cinnamon PPA with the same syntax as in point (1), although this is not the typical way for adding PPAs:

     $ sudo add-apt-repository http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-stable/ubuntu
    

    This would result in the following entry being added to /etc/apt/sources.list:

     deb http://ppa.launchpad.net/gwendal-lebihan-dev/cinnamon-stable/ubuntu saucy main
    

    This is the exact same entry as in point (2). Only the files that these entries are written to are handled slightly differently, but in the end, it makes no real difference. In both cases, you will end up with the packages from the Cinnamon PPA being available on your system, always after the canonical sudo apt-get update, of course.


Repositories

On systems like Ubuntu, most software is packaged in nice .deb (or .rpm, like in Red Hat) files which contain the programs and libraries you need. These files can be downloaded or come in CDs (Ubuntu's CD is full of them). Repositories are servers which contain sets of packages.

PPA

Personal Package Archives (PPA) allow you to upload Ubuntu source packages to be built and published as an apt repository by Launchpad.

Also see What are PPAs and how do I use them? and Wikipedia.

To sum it up:

  • A repository has packages.
  • PPAs are archives of personal packages.
  • Launchpad.net holds PPAs.

There is no technical differences between a repository and a PPA as far APT is concerned. Both are software repositories that offers packages, from APT point of view is the same mechanisms of installing packages.

PPA is a repository of packages that uses Launchpad as backend. Is just another name for the same thing, that is (at least in principle) normally used for personal reasons, which automates most operations you otherwise had to do manually or setting up your own services.

Repositories is wherever there is software, in this case, package lists and packages to be installed in Debian based distros.

You can have your personal repository, without the use of Launchpad and it could be called PPA, because is Personal.

The only difference in the usage is solely in the syntax of the add-apt-repository which uses the magic keyword ppa: instead of forcing the user to write the full url which is required for non Launchpad repositories.

Tags:

Repository

Ppa