Chapter 6. Basics of the Debian package management system
33
6.13 How do I install a source package?
Debian source packages can't actually be installed , they are just unpacked in whatever di
rectory you want to build the binary packages they produce.
Source packages are distributed on most of the same mirrors where you can obtain the binary
packages. If you set up your APT's
sources.list(5)
to include the appropriate deb src
lines, you'll be able to easily download any source packages by running
apt get source foo
To help you in actually building the source package, Debian source package provide the so
called build dependencies mechanism. This means that the source package maintainer keeps
a list of other packages that are required to build their package. To see how this is useful, run
apt get build dep foo
before building the source.
6.14 How do I build binary packages from a source package?
You will need all of foo_*.dsc, foo_*.tar.gz and foo_*.diff.gz to compile the source (note: there
is no .diff.gz for some packages that are native to Debian).
Once you have them (`How do I install a source package?' on this page), if you have the
dpkg dev
package installed, the following command:
dpkg source x foo_version revision.dsc
will extract the package into a directory called
foo version
.
If you want just to compile the package, you may cd into
foo version
directory and issue
the command
dpkg buildpackage rfakeroot b
to build the package (note that this also requires the
fakeroot
package), and then
dpkg i ../foo_version revision_arch.deb
to install the newly built package(s).
<
New Page 1
Web Hosting Colorado