Initial import
[debian/deb-download-from-pool.git] / README.rst
1 `deb-download-from-pool.sh` is a script to download a group of related deb
2 packages built from the same "src" package directly from the "pool" directory
3 of a Debian mirror.
4
5 It could be used to downgrade a group of packages when the latest version
6 introduces a regression, and previous versions are not available anymore for
7 the current distribution.
8
9
10 Examples
11 ========
12
13 Get version from testing
14 ------------------------
15
16 Sometimes a package gets updated in Debian unstable but it introduces
17 regressions, so reverting to the version in testing can be useful::
18
19    $ lsb_release --description
20    Description: Debian GNU/Linux unstable (sid)
21    $ rmadison -a $(dpkg-architecture -qDEB_BUILD_ARCH) libllvm7
22    libllvm7   | 1:7-6          | testing    | amd64
23    libllvm7   | 1:7.0.1~+rc2-2 | unstable   | amd64
24
25 However just specifying the version to `apt-get` is not enough if the old
26 version is not available anymore for unstable::
27
28    $ sudo apt-get install libllvm7=1:7-6
29    Reading package lists... Done
30    Building dependency tree       
31    Reading state information... Done
32    E: Version '1:7-6' for 'libllvm7' was not found
33
34 The official mechanism to get packages from different suites is to use pinning_.
35
36 .. _pinning: https://wiki.debian.org/AptPreferences#Pinning-1
37
38 Without pinning_ getting packages from different suites does not work::
39
40    $ sudo apt-get install -t testing libllvm7=1:7-6
41    Reading package lists... Done
42    E: The value 'testing' is invalid for APT::Default-Release as such a release is not available in the sources
43
44 With `deb-download-from-pool.sh` it is possible to get packages from *testing*
45 even if they are not directly available from *unstable* anymore::
46
47    $ ./deb-download-from-pool.sh libllvm7 7-6
48
49
50 Get ancient version from snapshot.debian.org
51 --------------------------------------------
52
53 Debian provides snapshots of mirrors at http://snapshot.debian.org/ and using
54 these it is possible to download ancient package versions.
55
56 Specifying a snapshot mirrors makes it possible to download very old packages::
57
58    MIRROR=http://snapshot.debian.org/archive/debian/20180904T211902Z/ \
59    DEBUG_MIRROR=http://snapshot.debian.org/archive/debian-debug/20180904T210823Z/ \
60    ./deb-download-from-pool.sh dash 0.5.8-2.10
61
62
63 Known Bugs
64 ==========
65
66 If no version is passed the script will list available versions on the mirror,
67 but it will do so regardless of what binaries are actually available for the
68 current architecture of the host running the script.
69
70 So it may list versions which could not be downloaded for the host.
71
72 A more reliable way to list version could be something like the following::
73
74    rmadison -a $(dpkg-architecture -qDEB_BUILD_ARCH) package_name
75
76 However this would not work with arbitrary mirrors, or snapshots.