Translations: English - Español - Français - Italiano - Português (Brasil) - Русский
How to build private backports. To create a personal repo for your backports, see DebianRepository/Setup. For backports suitable for uploading to backports.debian.org, see BuildingFormalBackports. For general packaging information, see Packaging.
Here we take the example of the package coreutils, from which we want to install a newer release available in testing. If the package you're looking for is not available in Testing, but it is in a Ubuntu PPA, you can have a look at CreatePackageFromPPA.
We don't need to be root here except the first and last steps.
Contents
- Install Debian packaging tools
- Find out which version is available in the Debian archive
- Add source package entries for the testing distribution
- Install build dependencies
- Indicate in the changelog a backport revision number
- Test if we can successfully build the package
- Build a package properly, without signing the package
- Install and enjoy!
- Go further
Describes a specific packaging workflow
This page describes one possible workflow to solve a specific problem. Parts of it may inspire you to find a workflow that suits your situation.
For more pages like this, see Packaging.
Install Debian packaging tools
sudo apt install dpkg-dev debian-keyring devscripts
Find out which version is available in the Debian archive
$ rmadison coreutils --architecture amd64 coreutils | 8.23-4 | oldstable | amd64 coreutils | 8.26-3 | stable | amd64 coreutils | 8.30-3 | testing | amd64 coreutils | 8.30-3 | unstable | amd64
Add source package entries for the testing distribution
If the package you are backporting isn't yet in testing, then use the suite it is currently in instead, such as unstable or experimental, instead of testing, in the instructions below.
Add a testing deb-src entries to your apt sources:
# Debian testing packages sources deb-src http://deb.debian.org/debian/ testing main
Update your packages index:
apt update
Download the package source:
apt source coreutils/testing
Install build dependencies
cd coreutils-*/ sudo mk-build-deps --install --remove
This will install a package named coreutils-build-deps depending on the listed build dependencies. 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.
Indicate in the changelog a backport revision number
dch --bpo
This will add something like ~bpo9+ to the package version number. The tilde ~ makes the package inferior in version, which should allow a proper package upgrade when you upgrade to the next Debian release (i.e. your package will be replaced with the official Debian package).
Test if we can successfully build the package
fakeroot debian/rules binary
If this should fail with a missing file, apt-file may be useful in locating the dependency you require.
Build a package properly, without signing the package
dpkg-buildpackage --build=binary --unsigned-changes
Install and enjoy!
sudo apt install ../coreutils_*_*.deb
Go further
You could have a look BuildingFormalBackports and contribute your backport to Debian as explained here: https://backports.debian.org/Contribute/
