5/16/2009

HOWTO: Add Launchpad's PPA APT Repository and Install Software from PPA

What is a Launchpad's PPA?

By giving developers a place to store their code, help compile it to Debian packages and organize those packages to an APT repository, the Launchpad's PPA considerably accelerates and simplifies the procedure to deploy latest software to end users, while maintaining the stability of the official repository.

Let me make an explanation on the above obscure summary. Ubuntu is a Linux distribution, an operating system assuming heavy responsibility of users' everyday work. Therefore, stability is more important than novelty. Typically, after a new final release, the official repository corresponding to that release is "frozen". During the freeze, only indispensable changes are allowed. In a word, for most software in the official repository, the version number will never increment.

However, in some cases, some new features from newer versions are indeed required to accomplish daily work. Users who have that requirement can add the PPA APT repository to their repositories, and the package manager will update the software to the latest version.

In another situation, users might wanna use, test or just preview newly created software of absence in the official repository. Once the corresponding PPA APT repository is added to the repositories, the package manager will show new packages containing that piece of new software ready to be installed.

Adding a PPA APT repository

Now let's take the OpenOffice.org Scribblers' PPA as an example. That PPA's overview page is located here:
https://launchpad.net/~openoffice-pkgs/+archive/ppa
Browse to the above URL, the page tells you how to add the PPA APT repository to repositories.

Assuming you are running Ubuntu 9.04 "Jaunty Jackalope", just add the following line to repositories:
deb http://ppa.launchpad.net/openoffice-pkgs/ppa/ubuntu jaunty main
Then refresh the local cache, from the package manager, packages of the latest version of OpenOffice.org will be seen! And the package manager will prompt you to update OpenOffice.org to the latest version!

Adding a PPA's keys to your system

Perhaps you will never ever think about the risk that there are possibilities that packages from a PPA are modified by some bad guys to achieve their evil goals. But developers will.

To ensure that packages are transfered to you without being altered illegally, you need to add the PPA's keys to your system, and your package manager will authenticate incoming packages.

Browse to the overview page again. Find a sentence like this:
This repository is signed with 1024R/247D1CFF OpenPGP key.
Click the link. Within the URL, look for a long number, like:
D2BB86E0EBD0F0A43D4DB3A760D11217247D1CFF
OK! You have got the fingerprint of the key.

Now run the following command in a terminal:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com D2BB86E0EBD0F0A43D4DB3A760D11217247D1CFF
And it's done.

Living in China?

Now comes a special trick for users in China. It has been reported that in most areas of China, connection to Launchpad is very slow, thus making installing software from Launchpad PPAs very time-consuming.

To settle that problem, the Chinese Ubuntu community has prepared a whole mirror of all Launchpad's PPAs! Again for the OpenOffice.org Scribblers' PPA, just add the following line instead:
deb http://archive.ubuntu.org.cn/ppa/openoffice-pkgs/ppa/ubuntu jaunty main
For other PPAs, it is the same. Just do the following replacement:
"http://ppa.launchpad.net/" -> "http://archive.ubuntu.org.cn/ppa/"
And enjoy the high speed.

No comments:

Post a Comment