6.4.10 Port a package to the stable system
For partial upgrades of the stable system, rebuilding a package
within its environment using the source package is desirable. This avoids
massive package upgrades due to their dependencies. First, add the following
entries to /etc/apt/sources.list
:
deb-src https://http.us.debian.org/debian testing \
main contrib non-free
deb-src https://http.us.debian.org/debian unstable \
main contrib non-free
Here each entry for deb-src is broken into two lines because of
printing constraints, but the actual entry in sources.list
should
consist of a single line.
Then get the source and make a local package:
$ apt-get update # update the source package search list
$ apt-get source package
$ dpkg-source -x package.dsc
$ cd package-version
... inspect required packages (Build-Depends in .dsc file) and
install them too. You need the "fakeroot" package also.
$ dpkg-buildpackage -rfakeroot
...or (no sig)
$ dpkg-buildpackage -rfakeroot -us -uc # use "debsign" later if needed
...Then to install
$ su -c "dpkg -i packagefile.deb"
Usually, one needs to install a few packages with the "-dev" suffix
to satisfy package dependencies. debsign
is in the
devscripts
package. auto-apt
may ease satisfying
these dependencies. Use of fakeroot
avoids unnecessary use of the
root account.
In Woody, these dependency issues can be simplified. For example, to compile a
source-only pine
package:
# apt-get build-dep pine
# apt-get source -b pine