| DGET(1) | DGET(1) |
dget - Download Debian source and binary packages
dget downloads Debian packages. In the first form, dget fetches the requested URLs. If this is a .dsc or .changes file, then dget acts as a source-package aware form of wget: it also fetches any files referenced in the .dsc/.changes file. The downloaded source is then checked with dscverify and, if successful, unpacked by dpkg-source.
In the second form, dget downloads a binary package (i.e., a .deb file) from the Debian mirror configured in /etc/apt/sources.list(.d). If a version number is specified, this version of the package is requested. With --all, the list of all binaries for the source package package is extracted from the output of "apt-cache showsrc package".
In both cases dget is capable of getting several packages and/or URLs at once.
(Note that .udeb packages used by debian-installer are located in separate packages files from .deb packages. In order to use .udebs with dget, you will need to have configured apt to use a packages file for component/debian-installer).
Before downloading files listed in .dsc and .changes files, and before downloading binary packages, dget checks to see whether any of these files already exist. If they do, then their md5sums are compared to avoid downloading them again unnecessarily. dget also looks for matching files in /var/cache/apt/archives and directories given by the --path option or specified in the configuration files (see below). Finally, if downloading (.orig).tar.gz or .diff.gz files fails, dget consults apt-get source --print-uris. Download backends used are curl and wget, looked for in that order.
dget package should be implemented in apt-get install -d.
dget was written to make it easier to retrieve source packages from the web to sponsor uploads, and thus the primary use case is downloading binary and source packages from a URL. For fetching packages from apt repositories it is easier to simply run apt-get download package and apt-get source package with optional --download-only to not uncompress it with dpkg-source automatically, or package=1.22-1 to define an exact version instead of just the latest version.
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 variable is:
Download all binary .deb files for current and previous version of a package, and compare them byte-for-byte with diffoscope:
mkdir previous latest (cd latest && dget --all mypackage=1.2-1) (cd previous && dget --all mypackage) # download latest 1.2-2 in this example diffoscope --html=diffoscope.html previous/ latest/
Download the source package of the current version in apt repository and the to-be-reviewed new version at mentors.debian.net, and compare them with debdiff:
dget https://mentors.debian.net/debian/pool/main/m/mypackage/mypackage_1.2-3.dsc apt-get source mypackage=1.2-2 debdiff --from mypackage_1.2-2.dsc --to mypackage_1.2-3.dsc
dget --all srcpkg should be implemented in apt-get download srcpkg so apt-get could download all binary packages based on source package name.
Before devscripts version 2.10.17, the default was not to extract the downloaded source. Set DGET_UNPACK=no to revert to the old behaviour.
This program is Copyright (C) 2005-2013 by Christoph Berg <myon@debian.org>. Modifications are Copyright (C) 2005-06 by Julian Gilbey <jdg@debian.org>.
This program is licensed under the terms of the GPL, either version 2 of the License, or (at your option) any later version.
apt-get(1), curl(1), debcheckout(1), debdiff(1), dpkg-source(1), wget(1)
| 2025-08-15 | Debian Utilities |