APT-SRC(1p) | User Contributed Perl Documentation | APT-SRC(1p) |
apt-src - manage debian source package trees
apt-src [options] command
apt-src [options] install|remove pkg1 [pkg2 ...]
apt-src location pkg
apt-src is a command line interface for downloading, installing, upgrading, and tracking debian source packages. It can be run as a normal user, or as root.
Unlike binary packages, source packages are not installed into a canonical location. Instead, they are "installed" by unpacking their source tree into a directory, which can be anywhere you wish. A source package can be installed multiple times, in different locations. This program manages source packages installed in this way, and provides querying facilities to help find where a source package is installed.
Unless the -h or --help option is given one of the commands below must be present.
This command will accept the names of binary packages, or source packages. Just like with apt-get install, you can prefix the name with =version or /release to specify what version to install or what release to take the source from.
It will make sure that the build-dependencies of the source package are satisfied.
If the --location option is given, the source package will be installed or upgraded into the given location instead of the current directory.
If the --build option is given, each newly installed or upgraded package will be compiled.
If the --patch option is given (the default), apt-src will attempt to generate a patch containing any local changes made to the source package, and will apply this patch to the updated tree. This will allow your local changes to be preserved across package upgrades, but it may not always work, and you might sometimes have to merge in your changes by hand.
If the --build option is given, each newly installed or upgraded package will be compiled.
This command can be used when you need to include files from another source package, or something like that. For example:
-I`apt-src location pkg`
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean options you can override the defaults file by using something like -f-,--no-f, -f=no or several other variations.
Note that if multiple packages are generated from a single source package, they will all be installed.
In addition to the above options, some less-used configuration items may only be specified in the config files, /etc/apt/apt.conf and ~/.apt-src/config. They are:
You can use either binary package names, or source package names when installing a new source package.
The rest of the time, when dealing with already installed packages, you currently have to use the source package names (this may later changes). However, you may use regexps as part of the names.
This program sets APT_SRC_BUILD when it is building a package.
To install the source to pine to /usr/src, build it, and install the resulting debs:
apt-src install --location=/usr/src -i pine
To track changes to said installed pine source package, and install debs whenever a new version comes out:
apt-src install -i pine
To install a local copy of package foo, which you are going to apply a local patch to:
apt-src install foo cd foo-version patch <~/my-foo-patch apt-src build --installdebs foo
To upgrade your local copy of foo, bringing your patch forward, and building and installing new debs:
apt-src install -i foo
To import the source tree in /usr/src/linux, which you unpacked from a ftp.kernel.org tarball (or from the kernel-source package) into apt-src, so it knows about it:
apt-src import kernel --location=/usr/src/linux --version=2.4.18
In a debian/rules of a kernel module package that needs to figure out if it is being built by apt-src, and if so set the KVERS, KSRC. and KDREV variables that make-kpkg normally sets:
ifdef APT_SRC_BUILD KDREV=$(shell apt-src version kernel\(-source.\*\)\?) KSRC=$(shell apt-src location kernel\(-source.\*\)\?) KVERS=$(shell apt-src name kernel\(-source.\*\)\? | sed s/kernel-source-//) endif
Copyright 2002 Joey Hess <joeyh@debian.org>
This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO warranty.
2016-12-21 | perl v5.24.1 |