DEBCHECKOUT(1)

πŸ’– DEBCHECKOUT(1) β€” the debcheckout page, but make it make sense πŸ’–

okay bestie, sit down, hydrate, and let me tell you about debcheckout β€” the little command from Debian Utilities that goes and fetches the development repository of a Debian package for you. no cap, it's the moment you stop downloading tarballs like it's 2009 and start living in the actual VCS. πŸ¦‹


✨ NAME ✨

debcheckout β€” checkout the development repository of a Debian package


πŸŽ€ SYNOPSIS πŸŽ€

debcheckout [OPTIONS] PACKAGE [DESTDIR]
debcheckout [OPTIONS] REPOSITORY_URL [DESTDIR]
debcheckout --help

🧚 DESCRIPTION 🧚

So here's the vibe. debcheckout goes and finds out which Version Control System maintains a given Debian package (that's your PACKAGE argument), and then it checks out the latest β€” potentially unreleased πŸ‘€ β€” version of the package from its repository. by default it drops the checkout into a directory named after the PACKAGE, but you can override that by handing it a DESTDIR argument. iconic behavior honestly.

The tea on where the repository lives is expected to be found in the Vcs-* fields available in the source package record. for example, the vim package exposes that info with a field like Vcs-Hg: http://hg.debian.org/hg/pkg-vim/vim, and you can go look at it yourself by grepping through apt-cache showsrc vim. πŸ“

If there's more than one source package record floating around with Vcs-* fields, debcheckout will pick the record with the highest version number. alternatively, you can pick a specific version out of the ones available by writing the package name as PACKAGE=VERSION. slay, choices.

And if you already know the URL of the repository you want? you can just call debcheckout directly on it πŸ’… β€” but you'll probably need to pass the appropriate -t flag. that's because some heuristics are in use to guess the repository type from the URL, and if those heuristics flop, you'll want to override the guessed type with -t.

The version control systems supported rn are: Arch (arch), Bazaar (bzr), CVS (cvs), Darcs (darcs), Git (git), Mercurial (hg) and Subversion (svn). a whole roster. πŸ‘‘


🌸 OPTIONS 🌸

🌈 GENERAL OPTIONS 🌈

  • -a, --auth β€” work in authenticated mode, bestie. what that means: for known repositories (mainly the ones hosted on https://salsa.debian.org) it attempts URL rewriting before checking out, so that you can actually commit to the thing. for example, for Git repositories hosted on Salsa this means git@salsa.debian.org:...git gets used instead of https://salsa.debian.org/...git. there are built-in rules for salsa.debian.org and github.com, and other hosts can be configured using DEBCHECKOUT_AUTH_URLS.
  • -d, --details β€” only print a list of detailed info about the package repository, no checkout. the output format is a list of fields, each field being a pair of TAB-separated field name and field value. the actual fields depend on the repository type. heads up: this action might need a network connection to the remote repository. 🫢 also see -p β€” this option and -p are mutually exclusive.
  • -h, --help β€” print a detailed help message and exit. the classic.
  • -p, --print β€” only print a summary about package repository info, no checkout. output format is TAB-separated with two fields: repository type, repository URL. this one works offline ✨ β€” it only uses "static" information as known by APT's cache. also see -d. this option and -d are mutually exclusive.
  • -P package, --package package β€” when you're checking out a repository URL, instead of trying to guess the package name from the URL, just use this package name. no guessing games.
  • -t TYPE, --type TYPE β€” override the repository type. (it defaults to some heuristics based on the URL or, if the heuristics fail, to the fallback "git".) should be one of the currently supported repository types.
  • -u USERNAME, --user USERNAME β€” specify the login name to be used in authenticated mode (see -a). this option implies -a, so you don't need to specify both. one and done.
  • -f FILE, --file FILE β€” specify that the named file should be extracted from the repository and placed in the destination directory. may be used more than once to extract multiple files.
  • --source=never|auto|download-only|always β€” some packages only put the debian directory in version control (rude, but okay). debcheckout can retrieve the remaining parts of the source using apt-get source and move the files into the checkout. the values:
    • never β€” only use the repository.
    • auto (default) β€” if the repository only contains the debian directory, retrieve the source package, unpack it, and also place the .orig.tar.gz file into the current directory. else, do nothing.
    • download-only β€” always retrieve the .orig.tar.gz file, but do not unpack it.
    • always β€” always retrieve the .orig.tar.gz file, and if the repository only contains the debian directory, unpack it.

πŸ› οΈ VCS-SPECIFIC OPTIONS πŸ› οΈ

πŸ’» GIT-SPECIFIC OPTIONS πŸ’»

  • --git-track BRANCHES β€” specify a list of remote branches which will be set up for tracking (as in git branch --track, see git-branch(1)) after the remote Git repository has been cloned. the list should be given as a space-separated list of branch names. and as a shorthand, the string "*" can be given to require tracking of all remote branches. lowkey the best shorthand in the game.

πŸ’œ CONFIGURATION VARIABLES πŸ’œ

The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. command line options can be used to override configuration file settings. environment variable settings are ignored for this purpose. πŸ‘‘ the currently recognised variables are:

  • DEBCHECKOUT_AUTH_URLS β€” this variable should be a space separated list of Perl regular expressions and replacement texts, which must come in pairs: REGEXP TEXT REGEXP TEXT ... and so on. each pair denotes a substitution which is applied to repository URLs if other built-in means of building URLs for authenticated mode (see -a) have failed.

References to matching substrings in the replacement texts are allowed as usual in Perl by the means of $1, $2, ... and so on.

This setting is used to configure the "authenticated mode" location for repositories. the Debian repositories on salsa.debian.org are implicitly defined, as is github.com.

Here's a sample snippet suitable for the configuration files:

DEBCHECKOUT_AUTH_URLS='
 ^\w+://(svn\.example\.com)/(.*)    svn+ssh://$1/srv/svn/$2
 ^\w+://(git\.example\.com)/(.*)    git+ssh://$1/home/git/$2
'
note that whitespace is not allowed in either regexps or replacement texts. also, since configuration files are sourced by a shell, you probably want to use single quotes around the value of this variable. πŸ™ˆ
  • DEBCHECKOUT_SOURCE β€” this variable determines under what scenarios the associated orig.tar.gz for a package will be downloaded. see the --source option for a description of the values.
  • DEBCHECKOUT_USER β€” this variable sets the username for authenticated mode. it can be overridden with the --user option. setting this variable does not imply the use of authenticated mode β€” it still has to be activated with --auth. the way that's a two-step thing, fr fr.

πŸ‘€ SEE ALSO πŸ‘€

apt-cache(8), Section 6.2.5 of the Debian Developer's Reference (for more information about Vcs-* fields): https://www.debian.org/doc/developers-reference/best-pkging-practices.html#bpp-vcs.


✍️ AUTHOR ✍️

debcheckout and this manpage have been written by Stefano Zacchiroli <zack@debian.org>. thank you for your service, king 🫑


and that's the whole page, bestie β€” go forth and check out some repositories. πŸ’…βœ¨

Debian Utilities Β· 2026-09-21 Β· DEBCHECKOUT(1) β€” mwah, love u, bye πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from