LinuxCommandLibrary

dget

Download Debian packages from a repository

TLDR

Download a binary package

$ dget [package]
copy

Download and extract a package source from its .dsc file
$ dget [http://deb.debian.org/debian/pool/main/h/haskell-tldr/haskell-tldr_0.4.0-2.dsc]
copy

Download a package source tarball from its .dsc file but don't extract it
$ dget [[-d|--download-only]] [http://deb.debian.org/debian/pool/main/h/haskell-tldr/haskell-tldr_0.4.0-2.dsc]
copy

SYNOPSIS

dget [options] <bugnum|package|URL> [destdir]

PARAMETERS

-d, --debug
    Enable verbose debugging output.

--proxy=URL
    Use specified HTTP proxy server.

--extract, -X
    Extract source package after downloading.

--no-extract, -x
    Do not extract package (default).

--overwrite
    Overwrite existing files in destdir.

--no-overwrite
    Do not overwrite files (default).

--checksums
    Verify file checksums against .dsc (default).

--no-checksums
    Skip checksum verification.

DESCRIPTION

dget is a command-line tool from the devscripts package on Debian-based systems like Ubuntu. It simplifies retrieving Debian source packages (.dsc files and associated tarballs) using a Debian BTS bug number, a source package name/version, or a direct URL to a .dsc file.

When given a bug number (e.g., 123456), dget fetches the most recent source package attachment from bugs.debian.org. For a package name (e.g., hello), it downloads the latest version from the Debian archive. URLs allow pulling from custom locations like mentors.debian.net.

Downloaded files include the .dsc, .orig.tar.gz, .debian.tar.gz (or equivalents). The --extract option unpacks the source tree into a directory named after the package version. Checksums are verified by default for integrity.

Ideal for Debian maintainers, contributors, and developers working on bug fixes or packaging. It streamlines workflows compared to manual downloads or browser use, integrating seamlessly with tools like dpkg-source for unpacking and building.

CAVEATS

Requires devscripts package installed. Needs internet access. Debian/Ubuntu-specific; may fail on non-Debian archives or invalid inputs.

EXAMPLES

dget 123456 — Download source from bug #123456.
dget hello — Fetch latest hello source package.
dget --extract https://example.com/hello_2.0-1.dsc — Download and unpack from URL.

HISTORY

Introduced in devscripts package around 2002 for Debian maintainers. Evolved with proxy support, extraction options, and checksum verification in later versions (e.g., devscripts 2.10+).

SEE ALSO

apt-get(8), dpkg-source(1), uscan(1), debcheckout(1)

Copied to clipboard