pk4 - make available the Debian source package producing the specified package
resolves the specified argument(s) as either:
- 1. the name of a Debian binary package, and selects its Debian source
- 2. the name of a Debian source package, and selects it.
- 3. or a file path, and selects the Debian source package of the owning
The source package version is either the installed version (if any) or the
installation candidate, as per apt-cache policy
Then, pk4 downloads the entire selected source package (every file referenced by
— and including — its .dsc file) and prints the output directory
- Whether to allow unauthenticated source packages, i.e. disable signature
- Restrict search to binary packages only.
- Whether to return shell completions. Should usually be set by shell
completion functions only.
- -dest string
- Directory in which to store source packages (default
- Interpret the argument as a file name and operate on the package providing
- Resolve the provided arguments to source package and source package
version, then print them to stdout in %s\t%s\n format and exit.
- -shell string
- Which shell to start in the output directory after downloading the source
- Restrict search to source packages only.
- Whether to print messages to stderr.
- -version string
- Use the specified source package version (default: installed package
version, or latest known if not installed).
# Avail the current Linux kernel sources:
pk4 -src linux
# Avail the sources which produced Debian binary package libbz2-1.0
# Avail the sources of whichever package currently provides vi:
pk4 -file $(which vi)
# Fetch the i3 source, apply a bugfix, rebuild and replace installed packages:
patch -p1 < /tmp/myfix.patch
# Avail all debhelper build system implementations:
pk4 -allow_unauthenticated $(grep '^dh-*' /var/cache/pk4/completion.both.txt)
# Grep through their sources:
grep -r option ~/.cache/pk4/dh-*
The following attributes can be configured in ~/.config/pk4/pk4.deb822
- Disk-Usage-Limit bytes
The following hooks can be configured:
- after-download hooks are run after the package was successfully
# Automatically create a git repository for each package:
mkdir -p ~/.config/pk4/hooks-enabled/after-download/
ln -s /usr/share/pk4/hooks-available/after-download/git-init \
- unpack hooks replace the unpack phase: as soon as one or more unpack hooks
are found, pk4 will run them instead of running dpkg-source -x.
# Unpack source into a new git-buildpackage repository:
apt install git-buildpackage
mkdir -p ~/.config/pk4/hooks-enabled/unpack/
ln -s /usr/share/pk4/hooks-available/unpack/gbp \
- (Re-)generate index files for pk4
- build sources and replace currently installed packages
Michael Stapelberg <stapelberg at debian.org>