Differences between revisions 57 and 80 (spanning 23 versions)
Revision 57 as of 2018-06-22 22:13:25
Size: 3412
Editor: ?annadane
Comment:
Revision 80 as of 2021-02-04 10:51:28
Size: 3203
Editor: ?AdrianFriedli
Comment: typo
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Please keep in mind that this is meant as a quick howto for how to build private backports and is not the way we expect from official backports for [[https://backports.debian.org/|backports.debian.org]]. For official backports, see [[https://wiki.debian.org/BuildingFormalBackports|this article]]. Please keep in mind that this is meant as a quick howto for how to build private backports and is not the way we expect from official backports for [[https://backports.debian.org/|backports.debian.org]]. For official backports, see [[BuildingFormalBackports|this wiki page]].
Line 8: Line 8:
Here we take the example of the package mame, from which we want to install a newer release availaible in sid/experimental. If the package you're looking for not available in Sid, but in a Ubuntu PPA, you can have a look at [[CreatePackageFromPPA]]. Here we take the example of the package coreutils, from which we want to install a newer release availaible in testing. If the package you're looking for not available in Testing, but in a Ubuntu PPA, you can have a look at [[CreatePackageFromPPA]].
Line 11: Line 11:

Another method for backporting a sid package to testing or stable is described in this [[DebianUnstable#backport|section]] of the Debian Unstable page in the Wiki.
Line 17: Line 15:
Line 22: Line 21:
{{{
rmadison mame --architecture amd64
 mame | 0.146-5 | wheezy/non-free | amd64
 mame | 0.146-5 | jessie/non-free | amd64
 mame | 0.146-5 | sid/non-free | amd64
 mame | 0.148-1 | experimental/non-free | amd64
}}}
===== Download the .dsc file from the sid release =====

From your Web browser at http://packages.debian.org/sid/mame, look at the .dsc file and copy the link location
Line 34: Line 23:
dget -x http://ftp.de.debian.org/debian/pool/non-free/m/mame/mame_0.148-1.dsc $ 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 =====

Add a testing '''deb-src''' entries to your [[SourcesList|apt sources]]:

{{{
# Debian testing packages sources
deb-src http://deb.debian.org/debian/ testing main
Line 37: Line 38:
'''''Note:''' If the above command complains about your `~/.gnupg` directory not being found, run `gpg -k` to initialize the GnuPG directory before retrying.'' Update your packages index:
Line 39: Line 40:
===== Find and install missing build dependencies as found in `debian/control` =====
Line 41: Line 41:
cd mame-0.148 apt update
}}}

Download the package source:

{{{
apt source coreutils/testing
}}}

===== Install build dependencies =====

{{{
cd coreutils-*/
Line 45: Line 57:
This will install a package named `mame-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-get autoremove`. 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`.
Line 48: Line 60:
Line 49: Line 62:
dch --local ~bpo9+ --distribution stretch-backports "Rebuild for stretch-backports." dch --bpo
Line 53: Line 66:
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). 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).
Line 56: Line 69:
Line 62: Line 76:
===== Build a package properly , without GPG signing the package ===== ===== Build a package properly, without GPG signing the package =====
Line 67: Line 82:
===== In case of build error, use the following command: =====
{{{
dpkg-buildpackage -b -us -uc
}}}
Line 68: Line 88:
Line 69: Line 90:
sudo dpkg -i ../mame_0.148-1~bpo9+1_amd64.deb sudo apt install ../coreutils_*_*.deb
Line 73: Line 94:
Line 74: Line 96:

----

CategoryPackaging

Translation(s): English - Español - Français - Italiano - Русский


Please keep in mind that this is meant as a quick howto for how to build private backports and is not the way we expect from official backports for backports.debian.org. For official backports, see this wiki page.

Here we take the example of the package coreutils, from which we want to install a newer release availaible in testing. If the package you're looking for not available in Testing, but 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.

Install Debian packaging tools

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

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

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 GPG signing the package

dpkg-buildpackage -us -uc

In case of build error, use the following command:

dpkg-buildpackage -b -us -uc

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: http://backports.debian.org/Contribute/


CategoryPackaging