You are not logged in.

#1 2015-09-29 17:52:46

hhh
Meep!
Registered: 2015-09-17
Posts: 7,682
Website

HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

A lot of people break Debian by trying to install packages from these sources. Silly people!  monkey  Many packages can be fairly easily repackaged for jessie/Hydrogen.

The first thing you'll need is the source entry for the package you're building in your /etc/apt/sources.list file. So, for a package from testing, something like...

deb-src http://ftp.debian.org/debian/ testing main contrib non-free

For a package from Ubuntu Trusty, something like...

deb-src http://cz.archive.ubuntu.com/ubuntu trusty main

For a PPA, go to it's Launchpad page, click on the "Technical details about this PPA" link and choose a version there, so something like...

deb-src http://ppa.launchpad.net/light-locker/release/ubuntu trusty main

Then update your sources, you can ignore any warnings about signing keys...

sudo apt-get update

Some PPA packages don't require a deb-src line, but adding one just to be sure won't hurt anything. Make sure to remove it when you're done installing your deb and then update your sources again.

You'll also need an URL to the dsc file for the package you're building. For example on the following pages you'll find them in the right-column, the first link under "Download source package"...

https://packages.debian.org/stretch/light-locker
http://packages.ubuntu.com/trusty/light-locker

For a PPA, click on "View package details" and then expand the correct version you find under "Series", the link is under "Package files"...
https://launchpad.net/~light-locker/+ar … /+packages

We're almost set, we just need to install the necessary development tools...

sudo apt-get install packaging-dev debian-keyring devscripts equivs


Okey dokey. Let's say you've found package foo's PPA and want to package the Trusty version, we'll try to build it on jessie. Create a directory named foo-build and change into it...

mkdir foo-build && cd foo-build

Copy the link to the dsc file you want to import...

https://launchpad.net/~foo/+archive/ubuntu/release/+files/foo_1.2.0%2B3%2B5%7Eubuntu14.04.1.dsc

And dget that source, extracting it and allowing an unauthorized download...

dget -xu https://launchpad.net/~foo/+archive/ubuntu/release/+files/foo_1.2.0%2B3%2B5%7Eubuntu14.04.1.dsc

You now have a version folder to move into...

cd foo-2015.07.06

Install the build dependencies and create a meta-package to easily remove them when you're done (it's a good idea to make a note of the name for the build-dep package it installs)...

sudo mk-build-deps --install --remove

Update the changelog and file-name...

dch --local ~bpo70+ --distribution jessie-backports "Rebuild for jessie-backports."

Build the sucker...

dpkg-buildpackage -us -uc

That (hopefully) creates the deb(s) in the foo-build directory so move there and install it (or them)...

cd .. && sudo dpkg -i *.deb

If there is an error message at the end, see if apt will install some missing dependencies...

sudo apt-get -f install

Remove the meta-package and build dependencies...

sudo apt-get purge foo-build-deps && sudo apt-get --purge autoremove

Undo or comment out your changes to /etc/apt/sources.list, run sudo apt-get update and delete the foo-build folder you made (if you want).

Ta da!  monkey

If you're having trouble with a particular package, open a thread in the System Administration section, maybe we can sort it out.

Online

#2 2015-09-30 10:42:10

hhh
Meep!
Registered: 2015-09-17
Posts: 7,682
Website

Re: HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

By the way, my OP is a consolidation of these two Debian Wiki pages...
https://wiki.debian.org/SimpleBackportCreation
https://wiki.debian.org/CreatePackageFromPPA

Online

#3 2015-10-09 07:11:10

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

Thank you for this, hhh.  wink

Offline

#4 2015-12-12 08:28:02

Obadobo
Member
Registered: 2015-10-26
Posts: 6

Re: HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

Brilliant HHH.  I have the version of the program I wanted and I felt like a cool hacker-geek while I was doing it!

Offline

#5 2016-04-20 18:31:33

jalexander9
Member
Registered: 2015-11-08
Posts: 152

Re: HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

Absolutely rock-solid great How-to, @hhh !!!

I confess this has saved Bunsenlabs configured on my system more than one time!

Offline

#6 2018-06-22 05:30:33

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,306
Website

Re: HowTo: Create debs from Testing/Unstable/Experimental/Ubuntu/PPA

To automate editing debian/changelog, try:

dch --bpo

Most of the stuff should be correctly filled in.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

Board footer

Powered by FluxBB