Ubuntu logo

App Developer

What are PPAs
Using a Personal Package Archive (PPA), you can distribute software and updates directly to Ubuntu users. Create your source package, upload it and Launchpad will build binaries (.deb files) and then host them in your own apt repository.

That means Ubuntu users can install your packages in just the same way they install standard Ubuntu packages and they’ll automatically receive updates as and when you make them.

PPAs are part of Launchpad, and thus follow the Launchpad terms of use:

As Launchpad has a limited amount of package build machines, the build queue can at times be clogged, so it might take longer until your packages are built, but normally you can expect built packages within an hour.

Creating your PPA

Ubuntu uses Launchpad as the central development platform. Bug reports, translations, code, packages, everything happens in Launchpad. You need to sign up, which is very easy to do and just takes a few minutes. To create an account simply head to https://launchpad.net/+login

To use PPAs you will need to sign the Code of Conduct. This is the foundation document of the Ubuntu community. To us it’s important that community members who offer software accept the same principles and share the same ethos and feeling for responsibility. To do this you will first have to set up a GPG key.

In standard Ubuntu, start the ‘seahorse’ program by hitting the Super key and searching for “Passwords and Encryption Keys”.

Then follow the on-screen instructions to sign the Code of Conduct at https://launchpad.net/codeofconduct

Setting up your PPA

You have multiple options when setting up the PPA.

First of all you can set up multiple PPAs. This makes sense if you have separate projects you maintain. As an app developer it makes sense to have a separate PPA for each app, so users can easily identify it.

Secondly you can create a PPA for a user, but also for a team. This means that if you maintain an app as a team, you would likely want to set it up for the development team instead, so everybody on the team can access it.

To create the PPA, simply head to either of the two:

Uploading packages to your PPA

To generate packages, you will need to install a few tools on your machine and configure a few things. This should just take a few minutes and is only required once.

First install the necessary tools by running:

Next edit your ~/.bashrc file and add something like the following in there:

export DEBFULLNAME="Bob Dobbs"
export DEBEMAIL="subgenius@example.com"

Then save the file and afterwards simply restart your terminal or run:

Releasing your app

Once you’re happy with your code and want to do a release, you document the changes in debian/changelog and give the release a version number.
It is very important to document your change sufficiently so developers who look at the code in the future won’t have to guess what your reasoning was and what your assumptions were. Every Debian and Ubuntu package source includes debian/changelog, where changes of each uploaded package are tracked.
The easiest way to update this is to run:

This will add a boilerplate changelog entry for you and launch an editor where you can fill in the blanks. An example of this could be:

superapp (1.4) precise; urgency=low

* New release:
+ add Frobicator support.
+ document frobnication properly.

– Emma Adams <emma.adams@isp.com> Sat, 17 Jul 2010 02:53:39 +0200

dch should fill out the first and last line of such a changelog entry for you already. Line 1 consists of the source package name, the version number, which Ubuntu release it is uploaded to, the urgency (which almost always is ‘low’). The last line always contains the name, email address and timestamp of the change.

Every new release should have a new changelog entry and the version number should be higher than the one before. “dch -i” will automatically take care of you for this, but if you want a different version number, you can edit it manually as well.

Test building locally
In some cases it makes sense to test a build locally before uploading it to Launchpad. Especially if it’s the first build you can easily verify if everything works according to plan. Luckily it’s very easy to set up a build environment with pbuilder.

pbuilder allows you to build packages locally on your machine. It serves a couple of purposes:

Setting pbuilder up is very easy, run:

where <release> is for example precise, quantal or raring or in the case of Debian maybe sid. This will take a while as it will download all the necessary packages for a “minimal installation”. These will be cached though.

To build a test package with your changes, run these commands:

This will create a source package from the branch contents and pbuilder-dist will build the package from source for whatever release you choose.
Once the build succeeds, install the package from ~/pbuilder/<release>_result/ (using sudo dpkg -i<package>_<version>.deb). Then test to see if the bug is fixed.

Distributing the apps from your PPA

To get your app out to users, you can give them very easy instructions to install your app by adding the PPA. If your Launchpad ID is “bobdobbs” and your PPA name is “superedit”, you could tell your users to simply:

Done. That’s it.

Getting help
The Ubuntu community provides you with a strong support network that can help you solve your development challenges. Join in and share your knowledge. http://developer.ubuntu.com/community/

For the majority of apps, what we describe in this article should make things work for you and get your app out there. There are obviously more options around and if your project starts growing, you might want to have a look into alternatives or extensions. If you generally want to know more about packaging, we highly recommend the Ubuntu Development Guide: : http://developer.ubuntu.com/resources/tools/packaging/