If a package is available in an Ubuntu PPA but not in Debian, in many cases you can easily rebuild it and install it on Debian.

The following example covers this process using the Pogo music player available in an Ubuntu PPA.

This basic process may also work for packages in any 3rd party repository that includes source packages.

Is the package really missing in Debian ? The package might not be available in your Debian version, but it may be available in testing/unstable.

You can check this with the command rmadison. If you're interested in a package called vagrant, try if the command rmadison vagrant returns something like:

vagrant | 1.6.5+dfsg1-2 | sid          | source, all

If you see the the package is available in sid, it means you should instead do a SimpleBackportCreation of the vagrant package.

Now if rmadison does not return anything, you can build the PPA package in the following 5 easy steps.

Install the Debian SDK

sudo apt install devscripts build-essential

A previous version of these instructions advised adding the PPA to /etc/apt/sources.list with the apt-add-repository tool. The following section has been rewritten to avoid problems that can be caused by this approach.

Get the Package Source

On the page https://launchpad.net/~pogo-dev/+archive/ubuntu/stable, click on "view package details", or go directly to https://launchpad.net/~pogo-dev/+archive/ubuntu/stable/+packages, which is the same url but with /+packages added to the end.

From this page, copy the url to the the changes file from the top link marked (changes file). (If you want to rebuild a previous version of the package, use the corresponding changes url instead.)

The url in this example is https://launchpad.net/~pogo-dev/+archive/ubuntu/stable/+files/pogo_1.0.1-0~717~ubuntu20.10.1_source.changes.

From a temporary working directory, run:

dget --extract --allow-unauthenticated https://launchpad.net/~pogo-dev/+archive/ubuntu/stable/+files/pogo_1.0.1-0~717~ubuntu20.10.1_source.changes

The --allow-unauthenticated option to dget means this does not verify the source against developer OpenPGP keys. Use at your own risk.

You should now have a directory called pogo-1.0.1.

Install the Package build-dependencies and Build the Package

As normal user:

cd pogo-1.0.1
sudo mk-build-deps --install --remove

This step generates and installs a dummy package that tells apt what packages are needed to build pogo. If you remove this package later, the actual build dependencies will be marked as "automatically installed and no longer needed" and can be cleared with apt autoremove.

As long as this completed with no errors, the package is ready to build. In the pogo-1.0.1 directory, run:

dpkg-buildpackage --build=binary --no-sign

Install the Resulting Package

You should now have a package in your top level working directory called something like pogo_1.0.1-0~717~ubuntu20.10.1_all.deb

Install it with:

sudo apt install ../pogo_1.0.1-0~717~ubuntu20.10.1_all.deb

Problems? Stuck?

Join us in #debian and tell us you are following these instructions, what step you are stuck on, and what happened. Read GettingHelpOnIrc for more information about debian IRC support.

Going further

If you find that the program you used would be of interest to other Debian users, check it if an "ITP:IntentToPackage" or a "RFP:RequestForPackage" bug report has been used. If no one has done this before, create a new bug report. For instance this the RFP for Pogo: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666008

If you feel brave, have a look at what's inside the pogo-1.0.1/debian/ directory, and read IntroDebianPackaging


CategoryPackaging