---
name: "pk4-replace"
section: "1"
platform: "linux"
package: "pk4"
version: "5+nmu1+b8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pk4-replace"
---

# pk4-replace(1)

build sources and replace currently installed packages

## NAME

pk4-replace - build sources and replace currently installed packages

## SYNOPSIS

**pk4-replace** \[**options**\]

## DESCRIPTION

**pk4-replace** builds the sources in the current directory using sbuild, then replaces the subset of currently installed binary packages with the newly built packages.

## OPTIONS

- **-dry\_run**

  Print the build command and exit

## EXAMPLES

- \# Fetch the i3 source, apply a bugfix, rebuild and replace installed packages:

  ```
  pk4 i3
  patch -p1 < /tmp/myfix.patch
  pk4-replace
  ```

## CONFIGURATION FILE

The following attributes can be configured in *~/.config/pk4/pk4.deb822*:

- **Build-Command *strings***

  The command to use for building the sources in the current directory. Must write the path to the resulting .changes file to the pipe **/proc/self/fd/3** when done.

Example (default):

```
Build-Command:
  sbuild
  --post-build-commands
  echo %SBUILD_CHANGES > /proc/self/fd/3
  -A
  --no-clean-source
  --dpkg-source-opt=--auto-commit
```

Example (illustrating how one line is one argv element):

```
Build-Command:
  sbuild
  --post-build-commands
  echo %SBUILD_CHANGES > /proc/self/fd/3
  -d
  stretch
```

## SEE ALSO

- *[pk4(1)](/pk4/1.md)*

  make available the Debian source package producing the specified package

- *[sbuild(1)](/sbuild/1.md)*

  build debian packages from source

## AUTHOR

Michael Stapelberg \<stapelberg at debian.org\>
