| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<HTML |
| 3 |
><HEAD |
| 4 |
><TITLE |
| 5 |
>The debdelta suite</TITLE |
| 6 |
><META |
| 7 |
NAME="GENERATOR" |
| 8 |
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK |
| 9 |
REL="NEXT" |
| 10 |
TITLE="a delta" |
| 11 |
HREF="x56.html"></HEAD |
| 12 |
><BODY |
| 13 |
CLASS="article" |
| 14 |
BGCOLOR="#FFFFFF" |
| 15 |
TEXT="#000000" |
| 16 |
LINK="#0000FF" |
| 17 |
VLINK="#840084" |
| 18 |
ALINK="#0000FF" |
| 19 |
><DIV |
| 20 |
CLASS="ARTICLE" |
| 21 |
><DIV |
| 22 |
CLASS="TITLEPAGE" |
| 23 |
><H1 |
| 24 |
CLASS="title" |
| 25 |
><A |
| 26 |
NAME="AEN1" |
| 27 |
>The debdelta suite</A |
| 28 |
></H1 |
| 29 |
><H3 |
| 30 |
CLASS="author" |
| 31 |
><A |
| 32 |
NAME="AEN4" |
| 33 |
>Andrea C. G. Mennucci</A |
| 34 |
></H3 |
| 35 |
><P |
| 36 |
CLASS="copyright" |
| 37 |
>Copyright © 2006-2024 </P |
| 38 |
><DIV |
| 39 |
><DIV |
| 40 |
CLASS="abstract" |
| 41 |
><P |
| 42 |
></P |
| 43 |
><A |
| 44 |
NAME="AEN8" |
| 45 |
></A |
| 46 |
><P |
| 47 |
>debdelta is an application suite designed to compute |
| 48 |
changes between Debian packages. These changes (that we will call |
| 49 |
'deltas') are similar to the output of the "diff" program in that |
| 50 |
they may be used to store and transmit only the changes between |
| 51 |
Debian packages. This suite contains 'debdelta-upgrade', that |
| 52 |
downloads deltas and use them to create all Debian packages needed |
| 53 |
for an 'apt-get upgrade'. </P |
| 54 |
><P |
| 55 |
></P |
| 56 |
></DIV |
| 57 |
></DIV |
| 58 |
><HR></DIV |
| 59 |
><DIV |
| 60 |
CLASS="TOC" |
| 61 |
><DL |
| 62 |
><DT |
| 63 |
><B |
| 64 |
>Table of Contents</B |
| 65 |
></DT |
| 66 |
><DT |
| 67 |
>1. <A |
| 68 |
HREF="index.html#AEN13" |
| 69 |
>Overview</A |
| 70 |
></DT |
| 71 |
><DD |
| 72 |
><DL |
| 73 |
><DT |
| 74 |
>1.1. <A |
| 75 |
HREF="index.html#AEN16" |
| 76 |
>debdelta</A |
| 77 |
></DT |
| 78 |
><DT |
| 79 |
>1.2. <A |
| 80 |
HREF="index.html#AEN21" |
| 81 |
>debpatch</A |
| 82 |
></DT |
| 83 |
><DT |
| 84 |
>1.3. <A |
| 85 |
HREF="index.html#AEN27" |
| 86 |
>debdeltas</A |
| 87 |
></DT |
| 88 |
><DT |
| 89 |
>1.4. <A |
| 90 |
HREF="index.html#AEN34" |
| 91 |
>debdelta-upgrade</A |
| 92 |
></DT |
| 93 |
><DT |
| 94 |
>1.5. <A |
| 95 |
HREF="index.html#AEN45" |
| 96 |
>debforensic</A |
| 97 |
></DT |
| 98 |
></DL |
| 99 |
></DD |
| 100 |
><DT |
| 101 |
>2. <A |
| 102 |
HREF="x56.html" |
| 103 |
>a delta</A |
| 104 |
></DT |
| 105 |
><DD |
| 106 |
><DL |
| 107 |
><DT |
| 108 |
>2.1. <A |
| 109 |
HREF="x56.html#AEN60" |
| 110 |
>the info in a delta</A |
| 111 |
></DT |
| 112 |
><DT |
| 113 |
>2.2. <A |
| 114 |
HREF="x56.html#AEN63" |
| 115 |
>how to apply a delta</A |
| 116 |
></DT |
| 117 |
></DL |
| 118 |
></DD |
| 119 |
><DT |
| 120 |
>3. <A |
| 121 |
HREF="x67.html" |
| 122 |
>new debdelta-upgrade service</A |
| 123 |
></DT |
| 124 |
><DD |
| 125 |
><DL |
| 126 |
><DT |
| 127 |
>3.1. <A |
| 128 |
HREF="x67.html#AEN71" |
| 129 |
>The framework</A |
| 130 |
></DT |
| 131 |
><DT |
| 132 |
>3.2. <A |
| 133 |
HREF="x67.html#AEN79" |
| 134 |
>The goals</A |
| 135 |
></DT |
| 136 |
><DT |
| 137 |
>3.3. <A |
| 138 |
HREF="x67.html#AEN87" |
| 139 |
>The repository structure</A |
| 140 |
></DT |
| 141 |
><DT |
| 142 |
>3.4. <A |
| 143 |
HREF="x67.html#delta_creation" |
| 144 |
>The repository creation</A |
| 145 |
></DT |
| 146 |
><DT |
| 147 |
>3.5. <A |
| 148 |
HREF="x67.html#AEN107" |
| 149 |
>size limit</A |
| 150 |
></DT |
| 151 |
><DT |
| 152 |
>3.6. <A |
| 153 |
HREF="x67.html#AEN111" |
| 154 |
>/etc/debdelta/sources.conf</A |
| 155 |
></DT |
| 156 |
><DT |
| 157 |
>3.7. <A |
| 158 |
HREF="x67.html#AEN120" |
| 159 |
>indexes</A |
| 160 |
></DT |
| 161 |
><DD |
| 162 |
><DL |
| 163 |
><DT |
| 164 |
>3.7.1. <A |
| 165 |
HREF="x67.html#AEN122" |
| 166 |
>indexes of debs in APT</A |
| 167 |
></DT |
| 168 |
><DT |
| 169 |
>3.7.2. <A |
| 170 |
HREF="x67.html#no_indexes" |
| 171 |
>no indexes of deltas in debdelta</A |
| 172 |
></DT |
| 173 |
></DL |
| 174 |
></DD |
| 175 |
><DT |
| 176 |
>3.8. <A |
| 177 |
HREF="x67.html#no_incremental" |
| 178 |
>no incremental deltas</A |
| 179 |
></DT |
| 180 |
><DD |
| 181 |
><DL |
| 182 |
><DT |
| 183 |
>3.8.1. <A |
| 184 |
HREF="x67.html#AEN136" |
| 185 |
>What "incremental" would be, and why it is not</A |
| 186 |
></DT |
| 187 |
></DL |
| 188 |
></DD |
| 189 |
><DT |
| 190 |
>3.9. <A |
| 191 |
HREF="x67.html#repo_howto" |
| 192 |
>Repository howto</A |
| 193 |
></DT |
| 194 |
><DD |
| 195 |
><DL |
| 196 |
><DT |
| 197 |
>3.9.1. <A |
| 198 |
HREF="x67.html#AEN159" |
| 199 |
>debdeltas_server</A |
| 200 |
></DT |
| 201 |
><DT |
| 202 |
>3.9.2. <A |
| 203 |
HREF="x67.html#AEN162" |
| 204 |
>debmirror --debmarshal</A |
| 205 |
></DT |
| 206 |
><DT |
| 207 |
>3.9.3. <A |
| 208 |
HREF="x67.html#AEN175" |
| 209 |
>hooks and repository of old_debs</A |
| 210 |
></DT |
| 211 |
></DL |
| 212 |
></DD |
| 213 |
></DL |
| 214 |
></DD |
| 215 |
><DT |
| 216 |
>4. <A |
| 217 |
HREF="x190.html" |
| 218 |
>Goals, tricks, ideas and issues</A |
| 219 |
></DT |
| 220 |
><DD |
| 221 |
><DL |
| 222 |
><DT |
| 223 |
>4.1. <A |
| 224 |
HREF="x190.html#AEN192" |
| 225 |
>exact patching</A |
| 226 |
></DT |
| 227 |
><DT |
| 228 |
>4.2. <A |
| 229 |
HREF="x190.html#AEN203" |
| 230 |
>exact recompression</A |
| 231 |
></DT |
| 232 |
><DT |
| 233 |
>4.3. <A |
| 234 |
HREF="x190.html#AEN212" |
| 235 |
>speed</A |
| 236 |
></DT |
| 237 |
><DD |
| 238 |
><DL |
| 239 |
><DT |
| 240 |
>4.3.1. <A |
| 241 |
HREF="x190.html#AEN214" |
| 242 |
>some (old) numbers</A |
| 243 |
></DT |
| 244 |
><DT |
| 245 |
>4.3.2. <A |
| 246 |
HREF="x190.html#AEN220" |
| 247 |
>speeding up</A |
| 248 |
></DT |
| 249 |
><DT |
| 250 |
>4.3.3. <A |
| 251 |
HREF="x190.html#AEN224" |
| 252 |
>the 10kb trick</A |
| 253 |
></DT |
| 254 |
><DT |
| 255 |
>4.3.4. <A |
| 256 |
HREF="x190.html#predictor" |
| 257 |
>the choice, the predictor</A |
| 258 |
></DT |
| 259 |
><DT |
| 260 |
>4.3.5. <A |
| 261 |
HREF="x190.html#AEN240" |
| 262 |
>State of the art</A |
| 263 |
></DT |
| 264 |
></DL |
| 265 |
></DD |
| 266 |
><DT |
| 267 |
>4.4. <A |
| 268 |
HREF="x190.html#the_enemy_within" |
| 269 |
>better deb compression is a worse delta</A |
| 270 |
></DT |
| 271 |
><DT |
| 272 |
>4.5. <A |
| 273 |
HREF="x190.html#long_time" |
| 274 |
>long time recovery</A |
| 275 |
></DT |
| 276 |
><DT |
| 277 |
>4.6. <A |
| 278 |
HREF="x190.html#AEN257" |
| 279 |
>streaming</A |
| 280 |
></DT |
| 281 |
><DT |
| 282 |
>4.7. <A |
| 283 |
HREF="x190.html#format_unzipped" |
| 284 |
>--format=unzipped</A |
| 285 |
></DT |
| 286 |
><DT |
| 287 |
>4.8. <A |
| 288 |
HREF="x190.html#format_preunpacked" |
| 289 |
>--format=preunpacked</A |
| 290 |
></DT |
| 291 |
></DL |
| 292 |
></DD |
| 293 |
><DT |
| 294 |
>5. <A |
| 295 |
HREF="x285.html" |
| 296 |
>Todo</A |
| 297 |
></DT |
| 298 |
><DD |
| 299 |
><DL |
| 300 |
><DT |
| 301 |
>5.1. <A |
| 302 |
HREF="x285.html#AEN287" |
| 303 |
>todo list</A |
| 304 |
></DT |
| 305 |
><DT |
| 306 |
>5.2. <A |
| 307 |
HREF="x285.html#getting_worse" |
| 308 |
>things are getting worse</A |
| 309 |
></DT |
| 310 |
></DL |
| 311 |
></DD |
| 312 |
></DL |
| 313 |
></DIV |
| 314 |
><DIV |
| 315 |
CLASS="section" |
| 316 |
><H1 |
| 317 |
CLASS="section" |
| 318 |
><A |
| 319 |
NAME="AEN13" |
| 320 |
>1. Overview</A |
| 321 |
></H1 |
| 322 |
><P |
| 323 |
> The debdelta application suite is really composed of different |
| 324 |
applications.</P |
| 325 |
><DIV |
| 326 |
CLASS="section" |
| 327 |
><H2 |
| 328 |
CLASS="section" |
| 329 |
><A |
| 330 |
NAME="AEN16" |
| 331 |
>1.1. debdelta</A |
| 332 |
></H2 |
| 333 |
><P |
| 334 |
> <B |
| 335 |
CLASS="command" |
| 336 |
>debdelta</B |
| 337 |
> computes the delta, that is, a file |
| 338 |
that encodes the difference between two Debian packages. |
| 339 |
|
| 340 |
Example: |
| 341 |
<PRE |
| 342 |
CLASS="programlisting" |
| 343 |
> $ a=/var/cache/apt/archives |
| 344 |
$ debdelta -v $a/emacs-snapshot-common_1%3a20060512-1_all.deb \ |
| 345 |
$a/emacs-snapshot-common_1%3a20060518-1_all.deb /tmp/emacs.debdelta |
| 346 |
</PRE |
| 347 |
> |
| 348 |
the result is: |
| 349 |
deb delta is 12.5% of deb ; that is, 15452kB would be saved |
| 350 |
</P |
| 351 |
></DIV |
| 352 |
><DIV |
| 353 |
CLASS="section" |
| 354 |
><H2 |
| 355 |
CLASS="section" |
| 356 |
><A |
| 357 |
NAME="AEN21" |
| 358 |
>1.2. debpatch</A |
| 359 |
></H2 |
| 360 |
><P |
| 361 |
> <B |
| 362 |
CLASS="command" |
| 363 |
>debpatch</B |
| 364 |
> |
| 365 |
can use the delta file and a copy of the old Debian package |
| 366 |
to recreate the new Debian package. (This process is called "applying |
| 367 |
the delta file"). If the old Debian package is not available, but is |
| 368 |
installed in the host, it can use the installed data; in this case, |
| 369 |
'/' is used in lieu of the old .deb. |
| 370 |
</P |
| 371 |
><P |
| 372 |
> Example: |
| 373 |
<PRE |
| 374 |
CLASS="programlisting" |
| 375 |
> $ debpatch -A /tmp/emacs.debdelta / /tmp/emacs.deb |
| 376 |
</PRE |
| 377 |
> |
| 378 |
</P |
| 379 |
></DIV |
| 380 |
><DIV |
| 381 |
CLASS="section" |
| 382 |
><H2 |
| 383 |
CLASS="section" |
| 384 |
><A |
| 385 |
NAME="AEN27" |
| 386 |
>1.3. debdeltas</A |
| 387 |
></H2 |
| 388 |
><P |
| 389 |
> <B |
| 390 |
CLASS="command" |
| 391 |
>debdeltas</B |
| 392 |
> |
| 393 |
can be used to generate deltas for many debs at once. |
| 394 |
It will generate delta files with names such as |
| 395 |
<TT |
| 396 |
CLASS="filename" |
| 397 |
>package_old-version_new-version_architecture.debdelta</TT |
| 398 |
>. |
| 399 |
|
| 400 |
If the delta exceeds ~70% of the deb, 'debdeltas' will delete it |
| 401 |
and leave a stamp of the form |
| 402 |
<TT |
| 403 |
CLASS="filename" |
| 404 |
>package_old-version_new-version_architecture.debdelta-too-big</TT |
| 405 |
>. |
| 406 |
|
| 407 |
Example usages are in the man page; see also <A |
| 408 |
HREF="x67.html#repo_howto" |
| 409 |
>Section 3.9</A |
| 410 |
>. |
| 411 |
</P |
| 412 |
></DIV |
| 413 |
><DIV |
| 414 |
CLASS="section" |
| 415 |
><H2 |
| 416 |
CLASS="section" |
| 417 |
><A |
| 418 |
NAME="AEN34" |
| 419 |
>1.4. debdelta-upgrade</A |
| 420 |
></H2 |
| 421 |
><P |
| 422 |
> <B |
| 423 |
CLASS="command" |
| 424 |
>debdelta-upgrade</B |
| 425 |
> |
| 426 |
will download necessary deltas |
| 427 |
and apply them to create debs for a |
| 428 |
successive <B |
| 429 |
CLASS="command" |
| 430 |
>apt-get upgrade</B |
| 431 |
>. |
| 432 |
|
| 433 |
The deltas are available for upgrades in |
| 434 |
'stable' , 'stable-security' , 'testing', 'unstable' and 'experimental', |
| 435 |
for architectures: all, i386 and amd64. |
| 436 |
|
| 437 |
As of 2024, there are also deltas to upgrade from any main release to its |
| 438 |
<SPAN |
| 439 |
CLASS="emphasis" |
| 440 |
><I |
| 441 |
CLASS="emphasis" |
| 442 |
>-backports</I |
| 443 |
></SPAN |
| 444 |
> or <SPAN |
| 445 |
CLASS="emphasis" |
| 446 |
><I |
| 447 |
CLASS="emphasis" |
| 448 |
>-security</I |
| 449 |
></SPAN |
| 450 |
> channel. |
| 451 |
|
| 452 |
Example usage: |
| 453 |
<PRE |
| 454 |
CLASS="programlisting" |
| 455 |
> # apt-get update && debdelta-upgrade && apt-get upgrade |
| 456 |
</PRE |
| 457 |
> |
| 458 |
If run by a non-root user, debs are saved in /tmp/archives : do not |
| 459 |
forget to move them in <TT |
| 460 |
CLASS="filename" |
| 461 |
>/var/cache/apt/archives</TT |
| 462 |
> |
| 463 |
</P |
| 464 |
><P |
| 465 |
> debdelta-upgrade will also download .debs for which no delta is |
| 466 |
available (this is done in parallel to patching, to maximize |
| 467 |
speed). See the explanation of "debdelta-upgrade --deb-policy" in the |
| 468 |
man page for more informations and customization on which debs get downloaded. |
| 469 |
</P |
| 470 |
><P |
| 471 |
> More informations are in next sections. |
| 472 |
</P |
| 473 |
></DIV |
| 474 |
><DIV |
| 475 |
CLASS="section" |
| 476 |
><H2 |
| 477 |
CLASS="section" |
| 478 |
><A |
| 479 |
NAME="AEN45" |
| 480 |
>1.5. debforensic</A |
| 481 |
></H2 |
| 482 |
><P |
| 483 |
> <SPAN |
| 484 |
CLASS="emphasis" |
| 485 |
><I |
| 486 |
CLASS="emphasis" |
| 487 |
> There is also another bunch of code |
| 488 |
(that though was never distributed.... it is available in the GIT repo). |
| 489 |
</I |
| 490 |
></SPAN |
| 491 |
>. |
| 492 |
<B |
| 493 |
CLASS="command" |
| 494 |
>debforensics</B |
| 495 |
> creates |
| 496 |
and uses sqlite databases containing information regarding |
| 497 |
debian binary packages. <B |
| 498 |
CLASS="command" |
| 499 |
>debforensics --add</B |
| 500 |
> |
| 501 |
will scan debian packages and add the list of files (and SHA1 hashes |
| 502 |
of them) to the database. <B |
| 503 |
CLASS="command" |
| 504 |
>debforensics --scan</B |
| 505 |
> |
| 506 |
will check a file against multiple databases, to see if that file is part |
| 507 |
of any package. <B |
| 508 |
CLASS="command" |
| 509 |
>debforensics --forensic</B |
| 510 |
> |
| 511 |
will scan a filesystem and list files that are part of a package, and |
| 512 |
files that are not (or are missplaced, or have strange permissions....). |
| 513 |
</P |
| 514 |
><P |
| 515 |
> If debdelta-upgrade fails to apply a delta, and '-d' is passed, |
| 516 |
then a debug file is generated, and then debforensic may be used |
| 517 |
to understand what went wrong (theoretically).</P |
| 518 |
><DIV |
| 519 |
CLASS="important" |
| 520 |
><P |
| 521 |
></P |
| 522 |
><TABLE |
| 523 |
CLASS="important" |
| 524 |
WIDTH="100%" |
| 525 |
BORDER="0" |
| 526 |
><TR |
| 527 |
><TD |
| 528 |
WIDTH="25" |
| 529 |
ALIGN="CENTER" |
| 530 |
VALIGN="TOP" |
| 531 |
><IMG |
| 532 |
SRC="../images/important.gif" |
| 533 |
HSPACE="5" |
| 534 |
ALT="Important"></TD |
| 535 |
><TD |
| 536 |
ALIGN="LEFT" |
| 537 |
VALIGN="TOP" |
| 538 |
><P |
| 539 |
>Beware: a full database for main/amd64 is |
| 540 |
~350MBs, without indexes. So in practice currently I cannot keep |
| 541 |
a database in my host.</P |
| 542 |
></TD |
| 543 |
></TR |
| 544 |
></TABLE |
| 545 |
></DIV |
| 546 |
></DIV |
| 547 |
></DIV |
| 548 |
></DIV |
| 549 |
><DIV |
| 550 |
CLASS="NAVFOOTER" |
| 551 |
><HR |
| 552 |
ALIGN="LEFT" |
| 553 |
WIDTH="100%"><TABLE |
| 554 |
SUMMARY="Footer navigation table" |
| 555 |
WIDTH="100%" |
| 556 |
BORDER="0" |
| 557 |
CELLPADDING="0" |
| 558 |
CELLSPACING="0" |
| 559 |
><TR |
| 560 |
><TD |
| 561 |
WIDTH="33%" |
| 562 |
ALIGN="left" |
| 563 |
VALIGN="top" |
| 564 |
> </TD |
| 565 |
><TD |
| 566 |
WIDTH="34%" |
| 567 |
ALIGN="center" |
| 568 |
VALIGN="top" |
| 569 |
> </TD |
| 570 |
><TD |
| 571 |
WIDTH="33%" |
| 572 |
ALIGN="right" |
| 573 |
VALIGN="top" |
| 574 |
><A |
| 575 |
HREF="x56.html" |
| 576 |
ACCESSKEY="N" |
| 577 |
>Next</A |
| 578 |
></TD |
| 579 |
></TR |
| 580 |
><TR |
| 581 |
><TD |
| 582 |
WIDTH="33%" |
| 583 |
ALIGN="left" |
| 584 |
VALIGN="top" |
| 585 |
> </TD |
| 586 |
><TD |
| 587 |
WIDTH="34%" |
| 588 |
ALIGN="center" |
| 589 |
VALIGN="top" |
| 590 |
> </TD |
| 591 |
><TD |
| 592 |
WIDTH="33%" |
| 593 |
ALIGN="right" |
| 594 |
VALIGN="top" |
| 595 |
>a delta</TD |
| 596 |
></TR |
| 597 |
></TABLE |
| 598 |
></DIV |
| 599 |
></BODY |
| 600 |
></HTML |
| 601 |
> |