Translation(s): none

(!) ?Discussion


Source Packages provide you with all of the necessary files to compile or otherwise, build the desired piece of software.

You can do a ?manual download", from http://www.debian.org/distrib/packages.en.html. The source packages end by *.dsc or *.tar.gz.

If you use have a deb-src entry in your /etc/apt/sources.list file, you can get one with apt-get source package_name. You can also use apt-get --build source package_name to automatically build the DebianPackage after download.

A source package is downloaded in the current directory and is not installed (it will not appear in the installed package list), so you need not be root to use apt-get source. However you need root privileges or fakeroot to build the .deb.

A source package could generate many .debs. To know the source package name, see the Source: field in apt-cache show package_name output.

See ?CopingWithUnstable for an example of how to create a package from source.

If you want to make optimized packages from source to your machine in order to possibly get faster operation, install and use ?apt-build (which in order uses apt-get source -b ...)

Extracting source files

Sources are normally not installed. You can only install them if you know the package name. When installing the sources of a debian package, a package ending on .dsc (description) is downloaded along with an original ?tar ball and a debian specific ?diff (compressed). The .dsc will contain the name of the package, both, in its filename as well as content (after the Source: keyword).

To unpack a source package, you can typically use :

assuming the files filename.tar.gz and filename.diff.gz (if applicable) are present in the same directory. It unpacks into package-version, and if applicable package-version.orig, in the current directory.

See also


CategoryPackageManagement