# man > debbisect(1)

---
type: CommandReference
command: debbisect
mode: man
section: 1
source: man-pages
---

## Quick Reference
- `debbisect "last week" today script.sh` — bisect between two timestamps using a script
- `debbisect --depends=botch "2018-11-17" "2018-11-22" 'chroot "$1" ...'` — bisect with automatic chroot setup and dependency resolution
- `debbisect --depends=botch --qemu=defaults "2018-11-17" "2018-11-22" 'ssh -F "$1" qemu ...'` — bisect inside a QEMU VM
- `debbisect --verbose --cache=./cache "two years ago" yesterday ./script.sh` — use a persistent cache to reduce bandwidth
- `debbisect --nocache "good" "bad" script` — disable caching mirror
- `DEBIAN_BISECT_SRCPKG=mysrc ./debbisect "two years ago" yesterday /usr/share/doc/devscripts/examples/debbisect_buildsrc.sh` — use a pre-built script for source package bisection
- `diff -u debbisect.log.good debbisect.log.bad` — compare logs after bisection

## Name
debbisect - bisect snapshot.debian.org

## Synopsis
shell
debbisect [-h] [-d] [-v] [--cache CACHE] [--nocache] [--port PORT]
          [--depends DEPENDS] [--qemu QEMU]
          [--architecture ARCHITECTURE] [--suite SUITE] [--components COMPONENTS]
          [--no-find-exact-package] good bad script
## Options
### Positional arguments
- `good` — good timestamp (see Timestamp Formats)
- `bad` — bad timestamp (see Timestamp Formats)
- `script` — shell code snippet or executable script. Non-zero exit code indicates failure. When `--depends` used, first argument is chroot directory. When `--qemu` used, first argument is SSH config for host `qemu`.

### Main options
- `-h, --help` — show help and exit
- `-d, --debug` — print debugging statements
- `-v, --verbose` — be verbose
- `--cache CACHE` — cache directory (default: `$TMPDIR`)
- `--nocache` — disable caching mirror
- `--port PORT` — manually choose port for apt cache (default: free port)
- `--depends DEPENDS` — comma-separated list of binary packages required by test script. Script runs inside a chroot with these packages installed.
- `--qemu QEMU` — create a QEMU VM and pass SSH config to script. Argument is comma-separated `key=value` pairs: `memsize` (memory size, default 1G), `disksize` (disk size, default 4G). Shorthand `defaults` for defaults.
- `--architecture ARCHITECTURE` — architecture for chroot/VM (default: native)
- `--suite SUITE` — suite for chroot/VM (default: unstable)
- `--components COMPONENTS` — components (comma/whitespace separated, default: main)
- `--no-find-exact-package` — disable automatic determination of the exact package that introduced the problem after bisection (only relevant with `--depends`)

## Timestamp Formats
Valid formats for `good` and `bad`:
- snapshot.debian.org format (e.g., `20200313T065326Z`)
- ISO 8601 (e.g., `2020-03-13T06:53:26+00:00`)
- RFC 2822 (e.g., `Fri, 29 Nov 2019 14:00:08 +0100`)
- Python dateutil module formats (if installed)
- Python parsedatetime module formats (if installed)
- Relative strings like `"two weeks ago"`

If no timezone is specified, local offset is used.

## Environment Variables
The following variables are available to the test script:
- `DEBIAN_BISECT_MIRROR` — caching mirror address
- `DEBIAN_BISECT_EPOCH` — integer Unix epoch of current timestamp (can be assigned to `SOURCE_DATE_EPOCH`)
- `DEBIAN_BISECT_TIMESTAMP` — timestamp in snapshot.debian.org format (e.g., `20200313T065326Z`)
- All variables starting with `DEBIAN_BISECT_` are passed to the test script.

## Examples
Basic bisect with script:
shell
$ ./debbisect "last week" today "mmdebstrap --customize-hook='chroot \"\$1\" do_something' unstable - \$DEBIAN_BISECT_MIRROR >/dev/null"
$ diff -u debbisect.log.good debbisect.log.bad
Using a cache and verbose output:
shell
$ cat > script.sh << 'END'
#!/bin/sh
set -exu
mmdebstrap \
  --verbose \
  --aptopt='Acquire::Check-Valid-Until "false"' \
  --variant=apt \
  --include=pkga,pkgb,pkgc \
  --customize-hook='chroot "$1" dpkg -l' \
  --customize-hook='chroot "$1" do_something' \
  unstable - \
  $DEBIAN_BISECT_MIRROR >/dev/null
END
$ chmod +x script.sh
$ ./debbisect --verbose --cache=./cache "two years ago" yesterday ./script.sh
$ diff -u debbisect.log.good debbisect.log.bad
$ rm -r ./cache
Using `--depends` to let debbisect manage chroot and pinpoint the exact package:
shell
$ ./debbisect --depends=botch "2018-11-17" "2018-11-22" 'chroot "$1" botch-dose2html --packages=/dev/null --help'
[...]
test upgrading python3-minimal 3.6.7-1 -> 3.7.1-2...
upgrading python3-minimal triggered the problem
Using `--qemu`:
shell
$ ./debbisect --depends=botch --qemu=defaults "2018-11-17" "2018-11-22" 'ssh -F "$1" qemu botch-dose2html --packages=/dev/null --help'
## See Also
- [DEBBISECT(1) man page](https://www.chedong.com/phpMan.php/man/DEBBISECT/1/markdown)
- `mmdebstrap(1)`, `debootstrap(1)`, `dpkg(1)`, `apt-get(8)`