This file is indexed.

/usr/share/debian-reference/ch02.en.html is in debian-reference-en 2.58.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Chapter 2. Debian package management</title>
    <link rel="stylesheet" type="text/css" href="debian-reference.css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="home" href="index.en.html" title="Debian Reference"/>
    <link rel="up" href="index.en.html" title="Debian Reference"/>
    <link rel="prev" href="ch01.en.html" title="Chapter 1. GNU/Linux tutorials"/>
    <link rel="next" href="ch03.en.html" title="Chapter 3. The system initialization"/>
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Chapter 2. Debian package management</th>
        </tr>
        <tr>
          <td align="left"><a accesskey="p" href="ch01.en.html"><img src="images/prev.png" alt="Prev"/></a> </td>
          <th width="60%" align="center"> </th>
          <td align="right"> <a accesskey="n" href="ch03.en.html"><img src="images/next.png" alt="Next"/></a></td>
        </tr>
      </table>
      <hr/>
    </div>
    <div class="chapter">
      <div class="titlepage">
        <div>
          <div>
            <h1 class="title"><a id="_debian_package_management"/>Chapter 2. Debian package management</h1>
          </div>
        </div>
      </div>
      <div class="toc">
        <p>
          <strong>Table of Contents</strong>
        </p>
        <dl class="toc">
          <dt>
            <span class="section">
              <a href="ch02.en.html#_debian_package_management_prerequisites">2.1. Debian package management prerequisites</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_package_configuration">2.1.1. Package configuration</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_basic_precautions">2.1.2. Basic precautions</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_life_with_eternal_upgrades">2.1.3. Life with eternal upgrades</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_debian_archive_basics">2.1.4. Debian archive basics</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_debian_is_100_free_software">2.1.5. Debian is 100% free software</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_package_dependencies">2.1.6. Package dependencies</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_event_flow_of_the_package_management">2.1.7. The event flow of the package management</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_first_response_to_package_management_troubles">2.1.8. First response to package management troubles</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_basic_package_management_operations">2.2. Basic package management operations</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_literal_apt_get_literal_literal_apt_cache_literal_vs_literal_aptitude_literal">2.2.1. <code class="literal">apt-get</code> / <code class="literal">apt-cache</code> vs. <code class="literal">aptitude</code></a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_basic_package_management_operations_with_the_commandline">2.2.2. Basic package management operations with the commandline</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_interactive_use_of_aptitude">2.2.3. Interactive use of aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_key_bindings_of_aptitude">2.2.4. Key bindings of aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_package_views_under_aptitude">2.2.5. Package views under aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_search_method_options_with_aptitude">2.2.6. Search method options with aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_aptitude_regex_formula">2.2.7. The aptitude regex formula</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_dependency_resolution_of_aptitude">2.2.8. Dependency resolution of aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_package_activity_logs">2.2.9. Package activity logs</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_examples_of_aptitude_operations">2.3. Examples of aptitude operations</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_listing_packages_with_regex_matching_on_package_names">2.3.1. Listing packages with regex matching on package names</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_browsing_with_the_regex_matching">2.3.2. Browsing with the regex matching</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_purging_removed_packages_for_good">2.3.3. Purging removed packages for good</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_tidying_auto_manual_install_status">2.3.4. Tidying auto/manual install status</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_system_wide_upgrade">2.3.5. System wide upgrade</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_advanced_package_management_operations">2.4. Advanced package management operations</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_advanced_package_management_operations_with_commandline">2.4.1. Advanced package management operations with commandline</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_verification_of_installed_package_files">2.4.2. Verification of installed package files</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_safeguarding_for_package_problems">2.4.3. Safeguarding for package problems</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_searching_on_the_package_meta_data">2.4.4. Searching on the package meta data</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_debian_package_management_internals">2.5. Debian package management internals</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_archive_meta_data">2.5.1. Archive meta data</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_top_level_release_file_and_authenticity">2.5.2. Top level "Release" file and authenticity</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_archive_level_release_files">2.5.3. Archive level "Release" files</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_fetching_of_the_meta_data_for_the_package">2.5.4. Fetching of the meta data for the package</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_package_state_for_apt">2.5.5. The package state for APT</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_package_state_for_aptitude">2.5.6. The package state for aptitude</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_local_copies_of_the_fetched_packages">2.5.7. Local copies of the fetched packages</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_debian_package_file_names">2.5.8. Debian package file names</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_dpkg_command">2.5.9. The dpkg command</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_update_alternatives_command">2.5.10. The update-alternatives command</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_dpkg_statoverride_command">2.5.11. The dpkg-statoverride command</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_dpkg_divert_command">2.5.12. The dpkg-divert command</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_recovery_from_a_broken_system">2.6. Recovery from a broken system</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_incompatibility_with_old_user_configuration">2.6.1. Incompatibility with old user configuration</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_different_packages_with_overlapped_files">2.6.2. Different packages with overlapped files</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_fixing_broken_package_script">2.6.3. Fixing broken package script</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_rescue_with_the_dpkg_command">2.6.4. Rescue with the dpkg command</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_recovering_package_selection_data">2.6.5. Recovering package selection data</a>
                </span>
              </dt>
            </dl>
          </dd>
          <dt>
            <span class="section">
              <a href="ch02.en.html#_tips_for_the_package_management">2.7. Tips for the package management</a>
            </span>
          </dt>
          <dd>
            <dl>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_how_to_pick_debian_packages">2.7.1. How to pick Debian packages</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_packages_from_mixed_source_of_archives">2.7.2. Packages from mixed source of archives</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_tweaking_candidate_version">2.7.3. Tweaking candidate version</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_updates_and_backports">2.7.4. Updates and Backports</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_blocking_packages_installed_by_recommends">2.7.5. Blocking packages installed by "Recommends"</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_tracking_literal_testing_literal_with_some_packages_from_literal_unstable_literal">2.7.6. Tracking <code class="literal">testing</code> with some packages from <code class="literal">unstable</code></a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_tracking_literal_unstable_literal_with_some_packages_from_literal_experimental_literal">2.7.7. Tracking <code class="literal">unstable</code> with some packages from <code class="literal">experimental</code></a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_automatic_download_and_upgrade_of_packages">2.7.8. Automatic download and upgrade of packages</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_limiting_download_bandwidth_for_apt">2.7.9. Limiting download bandwidth for APT</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_emergency_downgrading">2.7.10. Emergency downgrading</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_who_uploaded_the_package">2.7.11. Who uploaded the package?</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_the_equivs_package">2.7.12. The equivs package</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_porting_a_package_to_the_stable_system">2.7.13. Porting a package to the stable system</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_proxy_server_for_apt">2.7.14. Proxy server for APT</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_small_public_package_archive">2.7.15. Small public package archive</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_recording_and_copying_system_configuration">2.7.16. Recording and copying system configuration</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_converting_or_installing_an_alien_binary_package">2.7.17. Converting or installing an alien binary package</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_extracting_package_without_dpkg">2.7.18. Extracting package without dpkg</a>
                </span>
              </dt>
              <dt>
                <span class="section">
                  <a href="ch02.en.html#_more_readings_for_the_package_management">2.7.19. More readings for the package management</a>
                </span>
              </dt>
            </dl>
          </dd>
        </dl>
      </div>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
        <table border="0" summary="Note">
          <tr>
            <td rowspan="2" align="center" valign="top">
              <img alt="[Note]" src="images/note.png"/>
            </td>
            <th align="left">Note</th>
          </tr>
          <tr>
            <td align="left" valign="top">
              <p>This chapter is written assuming the latest stable release is codename: <code class="literal">jessie</code>.</p>
            </td>
          </tr>
        </table>
      </div>
      <p><a class="ulink" href="http://www.debian.org">Debian</a> is a volunteer organization which builds <span class="strong"><strong>consistent</strong></span> distributions of pre-compiled binary packages of free software and distributes them from its archive.</p>
      <p><a class="ulink" href="http://ftp.us.debian.org/debian/">The Debian archive</a> is offered by <a class="ulink" href="http://www.debian.org/mirror/">many remote mirror sites</a> for access through HTTP and FTP methods. It is also available as <a class="ulink" href="http://www.debian.org/CD/">CD-ROM/DVD</a>.</p>
      <p>The Debian package management system, <span class="strong"><strong>when used properly</strong></span>, offers the user to install <span class="strong"><strong>consistent sets of binary packages</strong></span> to the system from the archive.  Currently, there are 44893 packages available for the amd64 architecture.</p>
      <p>The Debian package management system has a rich history and many choices for the front end user program and back end archive access method to be used.  Currently, we recommend the following.</p>
      <div class="itemizedlist">
        <ul class="itemizedlist">
          <li class="listitem">
            <p><span class="citerefentry"><span class="refentrytitle">apt-get</span>(8)</span> for all commandline operations, including package installation and removal, and dist-upgrades.
</p>
          </li>
          <li class="listitem">
            <p><span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> for an interactive text interface to manage the installed packages and to search the available packages.
</p>
          </li>
        </ul>
      </div>
      <div class="table">
        <a id="listofdebianpackemanagementtools"/>
        <p class="title">
          <strong>Table 2.1. List of Debian package management tools</strong>
        </p>
        <div class="table-contents">
          <table summary="List of Debian package management tools" border="1">
            <colgroup>
              <col style="text-align: left"/>
              <col style="text-align: left"/>
              <col style="text-align: left"/>
              <col style="text-align: left"/>
            </colgroup>
            <thead>
              <tr>
                <th style="text-align: left">
    package
    </th>
                <th style="text-align: left">
    popcon
    </th>
                <th style="text-align: left">
    size
    </th>
                <th style="text-align: left">
    description
    </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt">
              <code class="literal">apt</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt">V:842, I:999</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt.html">3724</a>
                </td>
                <td style="text-align: left">
    Advanced Packaging Tool (APT), front-end for <code class="literal">dpkg</code> providing "<code class="literal">http</code>", "<code class="literal">ftp</code>", and "<code class="literal">file</code>" archive access methods (<code class="literal">apt-get</code>/<code class="literal">apt-cache</code> commands included)
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/aptitude">
              <code class="literal">aptitude</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=aptitude">V:232, I:991</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/aptitude.html">4532</a>
                </td>
                <td style="text-align: left">
    interactive terminal-based package manager with <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span>
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/tasksel">
              <code class="literal">tasksel</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=tasksel">V:45, I:968</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/t/tasksel.html">718</a>
                </td>
                <td style="text-align: left">
    tool for selecting tasks for installation on the Debian system (front-end for APT)
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/unattended-upgrades">
              <code class="literal">unattended-upgrades</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=unattended-upgrades">V:73, I:455</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/u/unattended-upgrades.html">343</a>
                </td>
                <td style="text-align: left">
    enhancement package for APT to enable automatic installation of security upgrades
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/dselect">
              <code class="literal">dselect</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=dselect">V:10, I:130</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/d/dselect.html">2620</a>
                </td>
                <td style="text-align: left">
    terminal-based package manager (previous standard, front-end for APT and other old access methods)
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/dpkg">
              <code class="literal">dpkg</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=dpkg">V:918, I:999</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/d/dpkg.html">6656</a>
                </td>
                <td style="text-align: left">
    package management system for Debian
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/synaptic">
              <code class="literal">synaptic</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=synaptic">V:96, I:471</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/s/synaptic.html">7672</a>
                </td>
                <td style="text-align: left">
    graphical package manager (GNOME front-end for APT)
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt-utils">
              <code class="literal">apt-utils</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-utils">V:302, I:996</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt-utils.html">1393</a>
                </td>
                <td style="text-align: left">
    APT utility programs: <span class="citerefentry"><span class="refentrytitle">apt-extracttemplates</span>(1)</span>, <span class="citerefentry"><span class="refentrytitle">apt-ftparchive</span>(1)</span>, and <span class="citerefentry"><span class="refentrytitle">apt-sortpkgs</span>(1)</span>
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt-listchanges">
              <code class="literal">apt-listchanges</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-listchanges">V:385, I:790</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt-listchanges.html">446</a>
                </td>
                <td style="text-align: left">
    package change history notification tool
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt-listbugs">
              <code class="literal">apt-listbugs</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-listbugs">V:8, I:13</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt-listbugs.html">520</a>
                </td>
                <td style="text-align: left">
    lists critical bugs before each APT installation
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt-file">
              <code class="literal">apt-file</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-file">V:18, I:86</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt-file.html">131</a>
                </td>
                <td style="text-align: left">
    APT package searching utility — command-line interface
    </td>
              </tr>
              <tr>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.debian.org/sid/apt-rdepends">
              <code class="literal">apt-rdepends</code>
            </a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-rdepends">V:1, I:8</a>
                </td>
                <td style="text-align: left">
                  <a class="ulink" href="http://packages.qa.debian.org/a/apt-rdepends.html">64</a>
                </td>
                <td style="text-align: left">
    recursively lists package dependencies
    </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <br class="table-break"/>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_debian_package_management_prerequisites"/>2.1. Debian package management prerequisites</h2>
            </div>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_package_configuration"/>2.1.1. Package configuration</h3>
              </div>
            </div>
          </div>
          <p>Here are some key points for package configuration on the Debian system.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The manual configuration by the system administrator is respected. In other words, the package configuration system makes no intrusive configuration for the sake of convenience.
</p>
              </li>
              <li class="listitem">
                <p>
Each package comes with its own configuration script with standardized user interface called <span class="citerefentry"><span class="refentrytitle">debconf</span>(7)</span> to help initial installation process of the package.
</p>
              </li>
              <li class="listitem">
                <p>
Debian Developers try their best to make your upgrade experience flawless with package configuration scripts.
</p>
              </li>
              <li class="listitem">
                <p>
Full functionalities of packaged software are available to the system administrator.  But ones with security risks are disabled in the default installation.
</p>
              </li>
              <li class="listitem">
                <p>
If you manually activate a service with some security risks, you are responsible for the risk containment.
</p>
              </li>
              <li class="listitem">
                <p>
Esoteric configuration may be manually enabled by the system administrator.  This may create interferences with popular generic helper programs for the system configuration.
</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_basic_precautions"/>2.1.2. Basic precautions</h3>
              </div>
            </div>
          </div>
          <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Warning">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Warning]" src="images/warning.png"/>
                </td>
                <th align="left">Warning</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Do not install packages from random mixture of suites.  It probably breaks the package consistency which requires deep system management knowledge, such as compiler <a class="ulink" href="http://en.wikipedia.org/wiki/Application_binary_interface">ABI</a>, <a class="ulink" href="http://en.wikipedia.org/wiki/Library_(computing)">library</a> version, interpreter features, etc.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>The <a class="ulink" href="http://en.wikipedia.org/wiki/Newbie">newbie</a> Debian system administrator should stay with the <span class="strong"><strong><code class="literal">stable</code></strong></span> release of Debian while applying only security updates.  I mean that some of the following valid actions are better avoided, as a precaution, until you understand the Debian system very well.  Here are some reminders.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Do not include <span class="strong"><strong><code class="literal">testing</code></strong></span> or <span class="strong"><strong><code class="literal">unstable</code></strong></span> in "<code class="literal">/etc/apt/sources.list</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not mix standard Debian with other non-Debian archives such as Ubuntu in "<code class="literal">/etc/apt/sources.list</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not create "<code class="literal">/etc/apt/preferences</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not change default behavior of package management tools through configuration files without knowing their full impacts.
</p>
              </li>
              <li class="listitem">
                <p>
Do not install random packages by "<code class="literal">dpkg -i &lt;random_package&gt;</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not ever install random packages by  "<code class="literal">dpkg --force-all -i &lt;random_package&gt;</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not erase or alter files in "<code class="literal">/var/lib/dpkg/</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Do not overwrite system files by installing software programs directly compiled from source.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
Install them into "<code class="literal">/usr/local</code>" or "<code class="literal">/opt</code>", if needed.
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <p>The non-compatible effects caused by above actions to the Debian package management system may leave your system unusable.</p>
          <p>The serious Debian system administrator who runs mission critical servers, should use extra precautions.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Do not install any packages including security updates from Debian without thoroughly testing them with your particular configuration under safe conditions.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
You as the system administrator are responsible for your system in the end.
</p>
                    </li>
                    <li class="listitem">
                      <p>
The long stability history of the Debian system is no guarantee by itself.
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_life_with_eternal_upgrades"/>2.1.3. Life with eternal upgrades</h3>
              </div>
            </div>
          </div>
          <p>Despite my warnings above, I know many readers of this document wish to run the <code class="literal">testing</code> or <code class="literal">unstable</code> suites of Debian as their main system for <span class="strong"><strong>self-administered Desktop environments</strong></span>. This is because they work very well, are updated frequently, and offer the latest features.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>For your <span class="strong"><strong>production server</strong></span>, the <code class="literal">stable</code> suite with the security updates is recommended.  The same can be said for desktop PCs on which you can spend limited administration efforts, e.g. for your mother's PC.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>It takes no more than simply setting the distribution string in the "<code class="literal">/etc/apt/sources.list</code>" to the suite name: "<code class="literal">testing</code>" or "<code class="literal">unstable</code>"; or the codename:  "<code class="literal">stretch</code>" or "<code class="literal">sid</code>". This makes you live <span class="strong"><strong>the life of eternal upgrades</strong></span>.</p>
          <p>The use of <code class="literal">testing</code> or <code class="literal">unstable</code> is <span class="strong"><strong>a lot of fun</strong></span> but comes with some risks.  Even though the <code class="literal">unstable</code> suite of the Debian system looks very stable for most of the times, there have been some package problems on the <code class="literal">testing</code> and <code class="literal">unstable</code> suite of the Debian system and a few of them were not so trivial to resolve. It may be <span class="strong"><strong>quite painful</strong></span> for you. Sometimes, you may have a broken package or missing functionality for a few weeks.</p>
          <p>Here are some ideas to ensure quick and easy recovery from bugs in Debian packages.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Make the system <span class="strong"><strong>dual bootable</strong></span> by installing the <code class="literal">stable</code> suite of the Debian system to another partition
</p>
              </li>
              <li class="listitem">
                <p>
Make the installation CD handy for the <span class="strong"><strong>rescue boot</strong></span>
</p>
              </li>
              <li class="listitem">
                <p>
Consider installing <code class="literal">apt-listbugs</code> to check the <a class="ulink" href="http://www.debian.org/Bugs/">Debian Bug Tracking System (BTS)</a> information before the upgrade
</p>
              </li>
              <li class="listitem">
                <p>
Learn the package system infrastructure enough to work around the problem
</p>
              </li>
              <li class="listitem">
                <p>
Create a chroot or similar environment and run the latest system in it in advance (see <a class="xref" href="ch09.en.html#_virtualized_system" title="9.10. Virtualized system">Section 9.10, “Virtualized system”</a>)
</p>
              </li>
            </ul>
          </div>
          <p>(If you can not do any one of these precautionary actions, you are probably not ready for the <code class="literal">testing</code> and <code class="literal">unstable</code> suites.)</p>
          <p><a class="ulink" href="http://en.wikipedia.org/wiki/Bodhi">Enlightenment</a> with the following saves a person from the eternal <a class="ulink" href="http://en.wikipedia.org/wiki/Karma">karmic</a> struggle of upgrade <a class="ulink" href="http://en.wikipedia.org/wiki/Naraka">hell</a> and let him reach Debian <a class="ulink" href="http://en.wikipedia.org/wiki/Nirvana">nirvana</a>.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_debian_archive_basics"/>2.1.4. Debian archive basics</h3>
              </div>
            </div>
          </div>
          <p>Let's look into <a class="ulink" href="http://ftp.us.debian.org/debian/">the Debian archive</a> from a system user's perspective.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Official policy of the Debian archive is defined at <a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-archive">Debian Policy Manual, Chapter 2 - The Debian Archive</a>.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>For the typical HTTP access, the archive is specified in the "<code class="literal">/etc/apt/sources.list</code>" file as the following, e.g. for the current <code class="literal">stable</code> = <code class="literal">jessie</code> system.</p>
          <pre class="screen">deb http://ftp.XX.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.XX.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib</pre>
          <p>Please note "<code class="literal">ftp.XX.debian.org</code>" must be replaced with appropriate mirror site URL for your location, for USA "<code class="literal">ftp.us.debian.org</code>", which can be found in <a class="ulink" href="http://www.debian.org/mirror/list">the list of Debian worldwide mirror sites</a>.  The status of these servers can be checked at <a class="ulink" href="http://ftp.de.debian.org/dmc/">Debian Mirror Checker site</a>.</p>
          <p>Here, I tend to use codename "<code class="literal">jessie</code>" instead of suite name "<code class="literal">stable</code>" to avoid surprises when the next <code class="literal">stable</code> is released.</p>
          <p>The meaning of "<code class="literal">/etc/apt/sources.list</code>" is described in <span class="citerefentry"><span class="refentrytitle">sources.list</span>(5)</span> and key points are followings.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The "<code class="literal">deb</code>" line defines for the binary packages.
</p>
              </li>
              <li class="listitem">
                <p>
The "<code class="literal">deb-src</code>" line defines for the source packages.
</p>
              </li>
              <li class="listitem">
                <p>
The 1st argument is the root URL of the Debian archive.
</p>
              </li>
              <li class="listitem">
                <p>
The 2nd argument is the distribution name: either the suite name or the codename.
</p>
              </li>
              <li class="listitem">
                <p>
The 3rd and following arguments are the list of valid archive area names of the Debian archive.
</p>
              </li>
            </ul>
          </div>
          <p>The "<code class="literal">deb-src</code>" lines can safely be omitted (or commented out by placing "#" at the start of the line) if it is just for <code class="literal">aptitude</code> which does not access source related meta data. It speeds up the updates of the archive meta data. The URL can be "<code class="literal">http://</code>", "<code class="literal">ftp://</code>", "<code class="literal">file://</code>", ….</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If "<code class="literal">sid</code>" is used in the above example instead of "<code class="literal">jessie</code>", the "<code class="literal">deb: http://security.debian.org/ …</code>" line for security updates in the "<code class="literal">/etc/apt/sources.list</code>" is not required.   This is because there is no security update archive for "<code class="literal">sid</code>" (<code class="literal">unstable</code>).</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Here is the list of URL of the Debian archive sites and suite name or codename used in the configuration file.</p>
          <div class="table">
            <a id="listofdebianarchivesites"/>
            <p class="title">
              <strong>Table 2.2. List of Debian archive sites</strong>
            </p>
            <div class="table-contents">
              <table summary="List of Debian archive sites" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    archive URL
    </th>
                    <th style="text-align: left">
    suite name (codename)
    </th>
                    <th style="text-align: left">
    purpose
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left"><code class="literal">stable</code> (<code class="literal">jessie</code>)
    </td>
                    <td style="text-align: left">
    stable (jessie) release
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left"><code class="literal">testing</code> (<code class="literal">stretch</code>)
    </td>
                    <td style="text-align: left">
    testing (stretch) release
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left"><code class="literal">unstable</code> (<code class="literal">sid</code>)
    </td>
                    <td style="text-align: left">
    unstable (sid) release
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">experimental</code>
                </td>
                    <td style="text-align: left">
    experimental pre-release (optional, only for developer)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">stable-proposed-updates</code>
                </td>
                    <td style="text-align: left">
    Updates for the next stable point release (optional)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://security.debian.org/">http://security.debian.org/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">stable/updates</code>
                </td>
                    <td style="text-align: left">
    security updates for stable release (important)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://security.debian.org/">http://security.debian.org/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">testing/updates</code>
                </td>
                    <td style="text-align: left">
    security updates for testing release (important)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">jessie-updates</code>
                </td>
                    <td style="text-align: left">
    compatible updates for spam filter, IM clients, etc. for jessie
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <a class="ulink" href="http://ftp.us.debian.org/debian/">http://ftp.XX.debian.org/debian/</a>
                </td>
                    <td style="text-align: left">
                  <code class="literal">jessie-backports</code>
                </td>
                    <td style="text-align: left">
    newer backported packages for jessie (optional)
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Only pure <span class="strong"><strong><code class="literal">stable</code></strong></span> release with security updates provides the best stability. Running mostly <span class="strong"><strong><code class="literal">stable</code></strong></span> release mixed with some packages from <span class="strong"><strong><code class="literal">testing</code></strong></span> or <span class="strong"><strong><code class="literal">unstable</code></strong></span> release is riskier than running pure <span class="strong"><strong><code class="literal">unstable</code></strong></span> release for library version mismatch etc.  If you really need the latest version of some programs under <span class="strong"><strong><code class="literal">stable</code></strong></span> release, please use packages from <a class="ulink" href="http://www.debian.org/News/2011/20110215">jessie-updates</a> and <a class="ulink" href="http://backports.debian.org">http://backports.debian.org</a> (see <a class="xref" href="ch02.en.html#_updates_and_backports" title="2.7.4. Updates and Backports">Section 2.7.4, “Updates and Backports”</a>) services.  These services must be used with extra care.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>You should basically list only one of <code class="literal">stable</code>, <code class="literal">testing</code>, or <code class="literal">unstable</code> suites in the "<code class="literal">deb</code>" line.  If you list any combination of <code class="literal">stable</code>, <code class="literal">testing</code>, and <code class="literal">unstable</code> suites in the "<code class="literal">deb</code>" line, APT programs slow down while only the latest archive is effective.  Multiple listing makes sense for these when the "<code class="literal">/etc/apt/preferences</code>" file is used with clear objectives (see <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a>).</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>For the Debian system with the <code class="literal">stable</code> and <code class="literal">testing</code> suites, it is a good idea to include lines with "<code class="literal">http://security.debian.org/</code>" in the "<code class="literal">/etc/apt/sources.list</code>" to enable security updates as in the example above.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The security bugs for the <code class="literal">stable</code> archive are fixed by the Debian security team.  This activity has been quite rigorous and reliable.  Those for the <code class="literal">testing</code> archive may be fixed by the Debian testing security team.  For <a class="ulink" href="http://lists.debian.org/debian-testing-security-announce/2008/12/msg00019.html">several</a> <a class="ulink" href="http://lists.debian.org/debian-testing-security-announce/2010/01/msg00000.html">reasons</a>, this activity is not as rigorous as that for <code class="literal">stable</code> and you may need to wait for the migration of fixed <code class="literal">unstable</code> packages.  Those for the <code class="literal">unstable</code> archive are fixed by the individual maintainer.  Actively maintained <code class="literal">unstable</code> packages are usually in a fairly good shape by leveraging latest upstream security fixes.  See <a class="ulink" href="http://www.debian.org/security/faq">Debian security FAQ</a> for how Debian handles security bugs.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="table">
            <a id="listofdebianarchivearea"/>
            <p class="title">
              <strong>Table 2.3. List of Debian archive area</strong>
            </p>
            <div class="table-contents">
              <table summary="List of Debian archive area" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    area
    </th>
                    <th style="text-align: left">
    number of packages
    </th>
                    <th style="text-align: left">
    criteria of package component
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">main</code>
                </td>
                    <td style="text-align: left">
    44118
    </td>
                    <td style="text-align: left">
    DFSG compliant and no dependency to <code class="literal">non-free</code>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">contrib</code>
                </td>
                    <td style="text-align: left">
    266
    </td>
                    <td style="text-align: left">
    DFSG compliant but having dependency to <code class="literal">non-free</code>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">non-free</code>
                </td>
                    <td style="text-align: left">
    509
    </td>
                    <td style="text-align: left">
    not DFSG compliant
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>Here the number of packages in the above is for the amd64 architecture.  The <code class="literal">main</code> area provides the Debian system (see <a class="xref" href="ch02.en.html#_debian_is_100_free_software" title="2.1.5. Debian is 100% free software">Section 2.1.5, “Debian is 100% free software”</a>).</p>
          <p>The Debian archive organization can be studied best by pointing your browser to the each archive URL appended with <code class="literal">dists</code> or <code class="literal">pool</code>.</p>
          <p>The distribution is referred by two ways, the suite or <a class="ulink" href="http://www.debian.org/doc/manuals/developers-reference/resources.html#codenames">codename</a>. The word distribution is alternatively used as the synonym to the suite in many documentations. The relationship between the suite and the codename can be summarized as the following.</p>
          <div class="table">
            <a id="therelationshipbsuiteandcodename"/>
            <p class="title">
              <strong>Table 2.4. The relationship between suite and codename</strong>
            </p>
            <div class="table-contents">
              <table summary="The relationship between suite and codename" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    Timing
    </th>
                    <th style="text-align: left">
    suite = <code class="literal">stable</code>
    </th>
                    <th style="text-align: left">
    suite = <code class="literal">testing</code>
    </th>
                    <th style="text-align: left">
    suite = <code class="literal">unstable</code>
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
    after the <code class="literal">jessie</code> release
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">jessie</code>
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">stretch</code>
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">sid</code>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    after the <code class="literal">stretch</code> release
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">stretch</code>
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">buster</code>
    </td>
                    <td style="text-align: left">
    codename = <code class="literal">sid</code>
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>The history of codenames are described in <a class="ulink" href="http://www.debian.org/doc/manuals/debian-faq/ch-ftparchives#s-oldcodenames">Debian FAQ: 6.2.1 Which other codenames have been used in the past?</a></p>
          <p>In the stricter Debian archive terminology, the word "section" is specifically used for the categorization of packages by the application area.  (Although, the word "main section" may sometimes be used to describe the Debian archive area named as "main".)</p>
          <p>Every time a new upload is done by a Debian developer (DD) to the <code class="literal">unstable</code> archive (via <a class="ulink" href="http://incoming.debian.org/">incoming</a> processing), the DD is required to ensure uploaded packages to be compatible with the latest set of packages in the latest <code class="literal">unstable</code> archive.</p>
          <p>If DD breaks this compatibility intentionally for important library upgrade etc, there is usually announcement to <a class="ulink" href="http://lists.debian.org/debian-devel/">the debian-devel mailing list</a> etc.</p>
          <p>Before a set of packages are moved by the Debian archive maintenance script from the <code class="literal">unstable</code> archive to the <code class="literal">testing</code> archive, the archive maintenance script not only checks the maturity (about 10 days old) and the status of the RC bug reports for the packages but also tries to ensure them to be compatible with the latest set of packages in the <code class="literal">testing</code> archive. This process makes the <code class="literal">testing</code> archive very current and usable.</p>
          <p>Through the gradual archive freeze process led by the release team, the <code class="literal">testing</code> archive is matured to make it completely consistent and bug free with some manual interventions.  Then the new <code class="literal">stable</code> release is created by assigning the codename for the old <code class="literal">testing</code> archive to the new <code class="literal">stable</code> archive and creating the new codename for the new <code class="literal">testing</code> archive.  The initial contents of the new <code class="literal">testing</code> archive is exactly the same as that of the newly released <code class="literal">stable</code> archive.</p>
          <p>Both the <code class="literal">unstable</code> and the <code class="literal">testing</code> archives may suffer temporary glitches due to several factors.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Broken package upload to the archive (mostly for <code class="literal">unstable</code>)
</p>
              </li>
              <li class="listitem">
                <p>
Delay of accepting the new packages to the archive (mostly for <code class="literal">unstable</code>)
</p>
              </li>
              <li class="listitem">
                <p>
Archive synchronization timing issue (both for <code class="literal">testing</code> and <code class="literal">unstable</code>)
</p>
              </li>
              <li class="listitem">
                <p>
Manual intervention to the archive such as package removal (more for <code class="literal">testing</code>) etc.
</p>
              </li>
            </ul>
          </div>
          <p>So if you ever decide to use these archives, you should be able to fix or work around these kinds of glitches.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>For about few months after a new <code class="literal">stable</code> release, most desktop users should use the <code class="literal">stable</code> archive with its security updates even if they usually use <code class="literal">unstable</code> or <code class="literal">testing</code> archives.  For this transition period, both <code class="literal">unstable</code> and <code class="literal">testing</code> archives are not good for most people. Your system is difficult to keep in good working condition with the <code class="literal">unstable</code> archive since it suffers surges of major upgrades for core packages.  The <code class="literal">testing</code> archive is not useful either since it contains mostly the same content as the <code class="literal">stable</code> archive without its security support (<a class="ulink" href="http://lists.debian.org/debian-testing-security-announce/2008/12/msg00019.html">Debian testing-security-announce 2008-12</a>). After a month or so, the <code class="literal">unstable</code> archive may be usable if you are careful.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When tracking the <code class="literal">testing</code> archive, a problem caused by a removed package is usually worked around by installing corresponding package from the <code class="literal">unstable</code> archive which is uploaded for bug fix.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>See <a class="ulink" href="http://www.debian.org/doc/debian-policy/">Debian Policy Manual</a> for archive definitions.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"<a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-archive#s-subsections">Sections</a>"
</p>
              </li>
              <li class="listitem">
                <p>
"<a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-archive#s-priorities">Priorities</a>"
</p>
              </li>
              <li class="listitem">
                <p>
"<a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-binary#s3.7">Base system</a>"
</p>
              </li>
              <li class="listitem">
                <p>
"<a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-binary#s3.8">Essential packages</a>"
</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_debian_is_100_free_software"/>2.1.5. Debian is 100% free software</h3>
              </div>
            </div>
          </div>
          <p>Debian is 100% free software because of the followings:</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Debian installs only free software by default to respect user's freedoms.
</p>
              </li>
              <li class="listitem">
                <p>
Debian provides only free software in <code class="literal">main</code>.
</p>
              </li>
              <li class="listitem">
                <p>
Debian recommends running only free software from <code class="literal">main</code>.
</p>
              </li>
              <li class="listitem">
                <p>
No packages in <code class="literal">main</code> depend nor recommend packages in <code class="literal">non-free</code> nor <code class="literal">contrib</code>.
</p>
              </li>
            </ul>
          </div>
          <p>Some people wonder if the following 2 facts contradict or not.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"Debian will remain 100% free". (First term of <a class="ulink" href="http://www.debian.org/social_contract">Debian Social Contract</a>)
</p>
              </li>
              <li class="listitem">
                <p>
Debian servers host some <code class="literal">non-free</code> and <code class="literal">contrib</code> packages.
</p>
              </li>
            </ul>
          </div>
          <p>These do not contradict, because of the followings.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The Debian system is 100% free and its packages are hosted by Debian servers in the <code class="literal">main</code> area.
</p>
              </li>
              <li class="listitem">
                <p>
Packages outside of the Debian system are hosted by Debian servers in the <code class="literal">non-free</code> and <code class="literal">contrib</code> areas.
</p>
              </li>
            </ul>
          </div>
          <p>These are precisely explained in the 4th and 5th terms of <a class="ulink" href="http://www.debian.org/social_contract">Debian Social Contract</a>:</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Our priorities are our users and free software
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
We will be guided by the needs of our users and the free software community. We will place their interests first in our priorities. We will support the needs of our users for operation in many different kinds of computing environments. We will not object to non-free works that are intended to be used on Debian systems, or attempt to charge a fee to people who create or use such works. We will allow others to create distributions containing both the Debian system and other works, without any fee from us. In furtherance of these goals, we will provide an integrated system of high-quality materials with no legal restrictions that would prevent such uses of the system.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
Works that do not meet our free software standards
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
We acknowledge that some of our users require the use of works that do not conform to the Debian Free Software Guidelines. We have created "<code class="literal">contrib</code>" and "<code class="literal">non-free</code>" areas in our archive for these works. The packages in these areas are not part of the Debian system, although they have been configured for use with Debian. We encourage CD manufacturers to read the licenses of the packages in these areas and determine if they can distribute the packages on their CDs. Thus, although non-free works are not a part of Debian, we support their use and provide infrastructure for non-free packages (such as our bug tracking system and mailing lists).
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <p>Users should be aware of the risks of using packages in the <code class="literal">non-free</code> and <code class="literal">contrib</code> areas:</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
lack of freedom for such software packages
</p>
              </li>
              <li class="listitem">
                <p>
lack of support from Debian on such software packages (Debian can't support software properly without having access to its source code.)
</p>
              </li>
              <li class="listitem">
                <p>
contamination of your 100% free Debian system
</p>
              </li>
            </ul>
          </div>
          <p>The <a class="ulink" href="http://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a> are the free software standards for <a class="ulink" href="http://www.debian.org">Debian</a>.  Debian interprets "software" in the widest scope including document, firmware, logo, and artwork data in the package.  This makes Debian's free software standards very strict ones.</p>
          <p>In order to meet this strict free software standards required for <code class="literal">main</code>, Debian <a class="ulink" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=354622">unbrands Mozilla</a> software packages such as Firefox, Thunderbird, and Seamonkey by removing their logo and some artwork data; and ships them as Iceweasel, Icedove, and Iceape, respectively.</p>
          <p>Typical <code class="literal">non-free</code> and <code class="literal">contrib</code> packages include freely distributable packages of following types:</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Document packages under <a class="ulink" href="http://en.wikipedia.org/wiki/GNU_Free_Documentation_License">GNU Free Documentation License</a> with invariant sections such as ones for GCC and Make.  (mostly found in the <code class="literal">non-free/doc</code> section.)
</p>
              </li>
              <li class="listitem">
                <p>
Firmware packages containing sourceless binary data such as ones listed in <a class="xref" href="ch09.en.html#_hardware_drivers_and_firmware" title="9.9.6. Hardware drivers and firmware">Section 9.9.6, “Hardware drivers and firmware”</a> as non-free. (mostly found in the <code class="literal">non-free/kernel</code> section.)
</p>
              </li>
              <li class="listitem">
                <p>
Game and font packages with restriction on commercial use and/or content modification.
</p>
              </li>
            </ul>
          </div>
          <p>Please note that the number of <code class="literal">non-free</code> and <code class="literal">contrib</code> packages is less than 2% of that of <code class="literal">main</code> packages.  Enabling access to the <code class="literal">non-free</code> and <code class="literal">contrib</code> areas does not obscure the source of packages.  Interactive full screen use of <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> provides you with full visibility and control over what packages are installed from which area to keep your system as free as you wish.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_package_dependencies"/>2.1.6. Package dependencies</h3>
              </div>
            </div>
          </div>
          <p>The Debian system offers a consistent set of binary packages through its versioned binary dependency declaration mechanism in the control file fields.   Here is a bit over simplified definition for them.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"Depends"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares an absolute dependency and all of the packages listed in this field must be installed at the same time or in advance.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Pre-Depends"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This is like Depends, except that it requires completed installation of the listed packages in advance.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Recommends"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares a strong, but not absolute, dependency.  Most users would not want the package unless all of the packages listed in this field are installed.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Suggests"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares a weak dependency.  Many users of this package may benefit from installing packages listed in this field but can have reasonable functions without them.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Enhances"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares a week dependency like Suggests but works in the opposite direction.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Breaks"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares a package incompatibility usually with some version specification.  Generally the resolution is to upgrade all of the packages listed in this field.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Conflicts"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This declares an absolute incompatibility.  All of the packages listed in this field must be removed to install this package.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Replaces"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This is declared when files installed by this package replace files in the listed packages.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
"Provides"
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This is declared when this package provide all of the files and functionality in the listed packages.
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Please note that defining "Provides", "Conflicts" and "Replaces" simultaneously to an virtual package is the sane configuration.  This ensures that only one real package providing this virtual package can be installed at any one time.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>The official definition including source dependency can be found in <a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-relationships">the Policy Manual: Chapter 7 - Declaring relationships between packages</a>.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_event_flow_of_the_package_management"/>2.1.7. The event flow of the package management</h3>
              </div>
            </div>
          </div>
          <p>Here is a summary of the simplified event flow of the package management by APT.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p><span class="strong"><strong>Update</strong></span> ("<code class="literal">aptitude update</code>" or "<code class="literal">apt-get update</code>"):
</p>
                <div class="orderedlist">
                  <ol class="orderedlist">
                    <li class="listitem">
                      <p>
Fetch archive metadata from remote archive
</p>
                    </li>
                    <li class="listitem">
                      <p>
Reconstruct and update local metadata for use by APT
</p>
                    </li>
                  </ol>
                </div>
              </li>
              <li class="listitem">
                <p><span class="strong"><strong>Upgrade</strong></span> ("<code class="literal">aptitude safe-upgrade</code>" and "<code class="literal">aptitude full-upgrade</code>", or "<code class="literal">apt-get upgrade</code>" and "<code class="literal">apt-get dist-upgrade</code>"):
</p>
                <div class="orderedlist">
                  <ol class="orderedlist">
                    <li class="listitem">
                      <p>
Chose candidate version which is usually the latest available version for all installed packages (see <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a> for exception)
</p>
                    </li>
                    <li class="listitem">
                      <p>
Make package dependency resolution
</p>
                    </li>
                    <li class="listitem">
                      <p>
Fetch selected binary packages from remote archive if candidate version is different from installed version
</p>
                    </li>
                    <li class="listitem">
                      <p>
Unpack fetched binary packages
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>preinst</strong></span> script
</p>
                    </li>
                    <li class="listitem">
                      <p>
Install binary files
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>postinst</strong></span> script
</p>
                    </li>
                  </ol>
                </div>
              </li>
              <li class="listitem">
                <p><span class="strong"><strong>Install</strong></span> ("<code class="literal">aptitude install …</code>" or "<code class="literal">apt-get install …</code>"):
</p>
                <div class="orderedlist">
                  <ol class="orderedlist">
                    <li class="listitem">
                      <p>
Chose packages listed on the command line
</p>
                    </li>
                    <li class="listitem">
                      <p>
Make package dependency resolution
</p>
                    </li>
                    <li class="listitem">
                      <p>
Fetch selected binary packages from remote archive
</p>
                    </li>
                    <li class="listitem">
                      <p>
Unpack fetched binary packages
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>preinst</strong></span> script
</p>
                    </li>
                    <li class="listitem">
                      <p>
Install binary files
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>postinst</strong></span> script
</p>
                    </li>
                  </ol>
                </div>
              </li>
              <li class="listitem">
                <p><span class="strong"><strong>Remove</strong></span> ("<code class="literal">aptitude remove …</code>" or "<code class="literal">apt-get remove …</code>"):
</p>
                <div class="orderedlist">
                  <ol class="orderedlist">
                    <li class="listitem">
                      <p>
Chose packages listed on the command line
</p>
                    </li>
                    <li class="listitem">
                      <p>
Make package dependency resolution
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>prerm</strong></span> script
</p>
                    </li>
                    <li class="listitem">
                      <p>
Remove installed files <span class="strong"><strong>except</strong></span> configuration files
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>postrm</strong></span> script
</p>
                    </li>
                  </ol>
                </div>
              </li>
              <li class="listitem">
                <p><span class="strong"><strong>Purge</strong></span> ("<code class="literal">aptitude purge …</code>" or "<code class="literal">apt-get purge …</code>"):
</p>
                <div class="orderedlist">
                  <ol class="orderedlist">
                    <li class="listitem">
                      <p>
Chose packages listed on the command line
</p>
                    </li>
                    <li class="listitem">
                      <p>
Make package dependency resolution
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>prerm</strong></span> script
</p>
                    </li>
                    <li class="listitem">
                      <p>
Remove installed files <span class="strong"><strong>including</strong></span> configuration files
</p>
                    </li>
                    <li class="listitem">
                      <p>
Run <span class="strong"><strong>postrm</strong></span> script
</p>
                    </li>
                  </ol>
                </div>
              </li>
            </ul>
          </div>
          <p>Here, I intentionally skipped technical details for the sake of big picture.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_first_response_to_package_management_troubles"/>2.1.8. First response to package management troubles</h3>
              </div>
            </div>
          </div>
          <p>You should read the fine official documentation.  The first document to read is the Debian specific "<code class="literal">/usr/share/doc/&lt;package_name&gt;/README.Debian</code>".  Other documentation in "<code class="literal">/usr/share/doc/&lt;package_name&gt;/</code>" should be consulted too.  If you set shell as <a class="xref" href="ch01.en.html#_customizing_bash" title="1.4.2. Customizing bash">Section 1.4.2, “Customizing bash”</a>, type the following.</p>
          <pre class="screen">$ cd &lt;package_name&gt;
$ pager README.Debian
$ mc</pre>
          <p>You may need to install the corresponding documentation package named with "<code class="literal">-doc</code>" suffix for detailed information.</p>
          <p>If you are experiencing problems with a specific package, make sure to check out <a class="ulink" href="http://bugs.debian.org/">the Debian bug tracking system (BTS)</a> sites, first.</p>
          <div class="table">
            <a id="listofkeywebsiteaspecificpackage"/>
            <p class="title">
              <strong>Table 2.5. List of key web site to resolving problems with a specific package</strong>
            </p>
            <div class="table-contents">
              <table summary="List of key web site to resolving problems with a specific package" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    web site
    </th>
                    <th style="text-align: left">
    command
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
    Home page of <a class="ulink" href="http://bugs.debian.org/">the Debian bug tracking system (BTS)</a>
    </td>
                    <td style="text-align: left">
                  <code class="literal">sensible-browser "http://bugs.debian.org/"</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The bug report of a known package name
    </td>
                    <td style="text-align: left">
                  <code class="literal">sensible-browser "http://bugs.debian.org/&lt;package_name&gt;"</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The bug report of known bug number
    </td>
                    <td style="text-align: left">
                  <code class="literal">sensible-browser "http://bugs.debian.org/&lt;bug_number&gt;"</code>
                </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>Search <a class="ulink" href="http://www.google.com">Google</a> with search words including "<code class="literal">site:debian.org</code>", "<code class="literal">site:wiki.debian.org</code>", "<code class="literal">site:lists.debian.org</code>", etc.</p>
          <p>When you file a bug report, please use <span class="citerefentry"><span class="refentrytitle">reportbug</span>(1)</span> command.</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_basic_package_management_operations"/>2.2. Basic package management operations</h2>
            </div>
          </div>
        </div>
        <p>Repository based package management operations on the Debian system can be performed by many APT-based package management tools available on the Debian system.  Here, we explain 2 basic package management tools: <code class="literal">apt-get</code> / <code class="literal">apt-cache</code> and <code class="literal">aptitude</code>.</p>
        <p>For the package management operation which involves package installation or updates package metadata, you need to have root privilege.</p>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_literal_apt_get_literal_literal_apt_cache_literal_vs_literal_aptitude_literal"/>2.2.1. <code class="literal">apt-get</code> / <code class="literal">apt-cache</code> vs. <code class="literal">aptitude</code></h3>
              </div>
            </div>
          </div>
          <p>Although <code class="literal">aptitude</code> is a very nice interactive tool which the author mainly uses, you should know some cautionary facts:</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The <code class="literal">aptitude</code> command is not recommended for the release-to-release system upgrade on the <code class="literal">stable</code> Debian system after the new release.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
The use of "<code class="literal">apt-get dist-upgrade</code>" is recommended for it.  See <a class="ulink" href="http://bugs.debian.org/411280">Bug #411280</a>.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
The <code class="literal">aptitude</code> command sometimes suggests mass package removals for the system upgrade on the <code class="literal">testing</code> or <code class="literal">unstable</code> Debian system.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
This situation has frightened many system administrators.  Don't panic.
</p>
                    </li>
                    <li class="listitem">
                      <p>
This seems to be caused mostly by the version skew among packages depended or recommended by a meta-package such as <code class="literal">gnome-core</code>.
</p>
                    </li>
                    <li class="listitem">
                      <p>
This can be resolved by selecting "Cancel pending actions" in the <code class="literal">aptitude</code> command menu, exiting <code class="literal">aptitude</code>, and using "<code class="literal">apt-get dist-upgrade</code>".
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <p>The <code class="literal">apt-get</code> and <code class="literal">apt-cache</code> commands are the most <span class="strong"><strong>basic</strong></span> APT-based package management tools.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p><code class="literal">apt-get</code> and <code class="literal">apt-cache</code> offer only the commandline user interface.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">apt-get</code> is most suitable for the <span class="strong"><strong>major system upgrade</strong></span> between releases, etc.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">apt-get</code> offers a <span class="strong"><strong>robust</strong></span> package dependency resolver.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">apt-get</code> is less demanding on hardware resources.  It consumes less memory and runs faster.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">apt-cache</code> offers a <span class="strong"><strong>standard</strong></span> regex based search on the package name and description.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">apt-get</code> and <code class="literal">apt-cache</code> can manage multiple versions of packages using <code class="literal">/etc/apt/preferences</code> but it is quite cumbersome.
</p>
              </li>
            </ul>
          </div>
          <p>The <code class="literal">aptitude</code> command is the most <span class="strong"><strong>versatile</strong></span> APT-based package management tool.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p><code class="literal">aptitude</code> offers the fullscreen interactive text user interface.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">aptitude</code> offers the commandline user interface, too.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">aptitude</code> is most suitable for the <span class="strong"><strong>daily interactive package management</strong></span> such as inspecting installed packages and searching available packages.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">aptitude</code> is more demanding on hardware resources.  It consumes more memory and runs slower.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">aptitude</code> offers an <span class="strong"><strong>enhanced</strong></span> regex based search on all of the package metadata.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">aptitude</code> can manage multiple versions of packages without using <code class="literal">/etc/apt/preferences</code> and it is quite intuitive.
</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_basic_package_management_operations_with_the_commandline"/>2.2.2. Basic package management operations with the commandline</h3>
              </div>
            </div>
          </div>
          <p>Here are basic package management operations with the commandline using <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">apt-get</span>(8)</span> /<span class="citerefentry"><span class="refentrytitle">apt-cache</span>(8)</span>.</p>
          <div class="table">
            <a id="basicpackagemanaaptgetiaptcachei"/>
            <p class="title">
              <strong>Table 2.6. Basic package management operations with the commandline using <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> and <span class="citerefentry"><span class="refentrytitle">apt-get</span>(8)</span> /<span class="citerefentry"><span class="refentrytitle">apt-cache</span>(8)</span></strong>
            </p>
            <div class="table-contents">
              <table summary="Basic package management operations with the commandline using aptitude8 and apt-get8 /apt-cache8" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left"><code class="literal">aptitude</code> syntax
    </th>
                    <th style="text-align: left"><code class="literal">apt-get</code>/<code class="literal">apt-cache</code> syntax
    </th>
                    <th style="text-align: left">
    description
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude update</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get update</code>
                </td>
                    <td style="text-align: left">
    update package archive metadata
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude install foo</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get install foo</code>
                </td>
                    <td style="text-align: left">
    install candidate version of "<code class="literal">foo</code>" package with its dependencies
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude safe-upgrade</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get upgrade</code>
                </td>
                    <td style="text-align: left">
    install candidate version of installed packages without removing any other packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude full-upgrade</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get dist-upgrade</code>
                </td>
                    <td style="text-align: left">
    install candidate version of installed packages while removing other packages if needed
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude remove foo</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get remove foo</code>
                </td>
                    <td style="text-align: left">
    remove "<code class="literal">foo</code>" package while leaving its configuration files
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    N/A
    </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get autoremove</code>
                </td>
                    <td style="text-align: left">
    remove auto-installed packages which are no longer required
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude purge foo</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get purge foo</code>
                </td>
                    <td style="text-align: left">
    purge "<code class="literal">foo</code>" package with its configuration files
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude clean</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get clean</code>
                </td>
                    <td style="text-align: left">
    clear out the local repository of retrieved package files completely
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude autoclean</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-get autoclean</code>
                </td>
                    <td style="text-align: left">
    clear out the local repository of retrieved package files for outdated packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude show foo</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-cache show foo</code>
                </td>
                    <td style="text-align: left">
    display detailed information about "<code class="literal">foo</code>" package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude search &lt;regex&gt;</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">apt-cache search &lt;regex&gt;</code>
                </td>
                    <td style="text-align: left">
    search packages which match &lt;regex&gt;
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude why &lt;regex&gt;</code>
                </td>
                    <td style="text-align: left">
    N/A
    </td>
                    <td style="text-align: left">
    explain the reason why &lt;regex&gt; matching packages should be installed
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude why-not &lt;regex&gt;</code>
                </td>
                    <td style="text-align: left">
    N/A
    </td>
                    <td style="text-align: left">
    explain the reason why &lt;regex&gt; matching packages can not be installed
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Although the <code class="literal">aptitude</code> command comes with rich features such as its enhanced package resolver, this complexity has caused (or may still causes) some regressions such as <a class="ulink" href="http://bugs.debian.org/411123">Bug #411123</a>, <a class="ulink" href="http://bugs.debian.org/514930">Bug #514930</a>, and <a class="ulink" href="http://bugs.debian.org/570377">Bug #570377</a>.  In case of doubt, please use the <code class="literal">apt-get</code> and <code class="literal">apt-cache</code> commands over the <code class="literal">aptitude</code> command.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Since <code class="literal">apt-get</code> and <code class="literal">aptitude</code> share auto-installed package status (see <a class="xref" href="ch02.en.html#_the_package_state_for_apt" title="2.5.5. The package state for APT">Section 2.5.5, “The package state for APT”</a>) after <code class="literal">lenny</code>, you can mix these tools without major troubles (see <a class="ulink" href="http://bugs.debian.org/594490">Bug #594490</a>).</p>
                </td>
              </tr>
            </table>
          </div>
          <p>The "<code class="literal">aptitude why &lt;regex&gt;</code>" can list more information by "<code class="literal">aptitude -v why &lt;regex&gt;</code>".  Similar information can be obtained by "<code class="literal">apt-cache rdepends &lt;package&gt;</code>".</p>
          <p>When <code class="literal">aptitude</code> command is started in the commandline mode and faces some issues such as package conflicts, you can switch to the full screen interactive mode by pressing "<code class="literal">e</code>"-key later at the prompt.</p>
          <p>You may provide command options right after "<code class="literal">aptitude</code>".</p>
          <div class="table">
            <a id="notablecommandopionsforaptitudei"/>
            <p class="title">
              <strong>Table 2.7. Notable command options for <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span></strong>
            </p>
            <div class="table-contents">
              <table summary="Notable command options for aptitude8" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    command option
    </th>
                    <th style="text-align: left">
    description
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">-s</code>
                </td>
                    <td style="text-align: left">
    simulate the result of the command
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">-d</code>
                </td>
                    <td style="text-align: left">
    download only but no install/upgrade
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">-D</code>
                </td>
                    <td style="text-align: left">
    show brief explanations before the automatic installations and removals
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>See <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> and "aptitude user's manual" at "<code class="literal">/usr/share/doc/aptitude/README</code>" for more.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The <code class="literal">dselect</code> package is still available and was the preferred full screen interactive package management tool in previous releases.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_interactive_use_of_aptitude"/>2.2.3. Interactive use of aptitude</h3>
              </div>
            </div>
          </div>
          <p>For the interactive package management, you start <code class="literal">aptitude</code> in interactive mode from the console shell prompt as follows.</p>
          <pre class="screen">$ sudo aptitude -u
Password:</pre>
          <p>This updates the local copy of the archive information and display the package list in the full screen with menu.  Aptitude places its configuration at "<code class="literal">~/.aptitude/config</code>".</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If you want to use root's configuration instead of user's one, use "<code class="literal">sudo -H aptitude …</code>" instead of "<code class="literal">sudo aptitude …</code>" in the above expression.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p><code class="literal">Aptitude</code> automatically sets <span class="strong"><strong>pending actions</strong></span> as it is started interactively. If you do not like it, you can reset it from menu: "Action" → "Cancel pending actions".</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_key_bindings_of_aptitude"/>2.2.4. Key bindings of aptitude</h3>
              </div>
            </div>
          </div>
          <p>Notable key strokes to browse status of packages and to set "planned action" on them in this full screen mode are the following.</p>
          <div class="table">
            <a id="listofkeybindingsforaptitude"/>
            <p class="title">
              <strong>Table 2.8. List of key bindings for aptitude</strong>
            </p>
            <div class="table-contents">
              <table summary="List of key bindings for aptitude" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    key
    </th>
                    <th style="text-align: left">
    key binding
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left"><code class="literal">F10</code> or <code class="literal">Ctrl-t</code>
    </td>
                    <td style="text-align: left">
    menu
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">?</code>
                </td>
                    <td style="text-align: left">
    display <span class="strong"><strong>help</strong></span> for keystroke (more complete listing)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left"><code class="literal">F10</code> → Help → User's Manual
    </td>
                    <td style="text-align: left">
    display User's Manual
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">u</code>
                </td>
                    <td style="text-align: left">
    update package archive information
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">+</code>
                </td>
                    <td style="text-align: left">
    mark the package for the <span class="strong"><strong>upgrade</strong></span> or the <span class="strong"><strong>install</strong></span>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">-</code>
                </td>
                    <td style="text-align: left">
    mark the package for the <span class="strong"><strong>remove</strong></span> (keep configuration files)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">_</code>
                </td>
                    <td style="text-align: left">
    mark the package for the <span class="strong"><strong>purge</strong></span> (remove configuration files)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">=</code>
                </td>
                    <td style="text-align: left">
    place the package on <span class="strong"><strong>hold</strong></span>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">U</code>
                </td>
                    <td style="text-align: left">
    mark all upgradable packages (function as <span class="strong"><strong>full-upgrade</strong></span>)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">g</code>
                </td>
                    <td style="text-align: left">
    start <span class="strong"><strong>downloading</strong></span> and <span class="strong"><strong>installing</strong></span> selected packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">q</code>
                </td>
                    <td style="text-align: left">
    quit current screen and save changes
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">x</code>
                </td>
                    <td style="text-align: left">
    quit current screen and discard changes
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Enter</code>
                </td>
                    <td style="text-align: left">
    view information about a package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">C</code>
                </td>
                    <td style="text-align: left">
    view a package's changelog
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">l</code>
                </td>
                    <td style="text-align: left">
    change the limit for the displayed packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/</code>
                </td>
                    <td style="text-align: left">
    search for the first match
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">\</code>
                </td>
                    <td style="text-align: left">
    repeat the last search
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>The file name specification of the command line and the menu prompt after pressing "<code class="literal">l</code>" and "<code class="literal">//</code>" take the aptitude regex as described below.  Aptitude regex can explicitly match a package name using a string started by "<code class="literal">~n</code> and followed by the package name.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>You need to press "<code class="literal">U</code>" to get all the installed packages upgraded to the <span class="strong"><strong>candidate version</strong></span> in the visual interface.  Otherwise only the selected packages and certain packages with versioned dependency to them are upgraded to the <span class="strong"><strong>candidate version</strong></span>.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_package_views_under_aptitude"/>2.2.5. Package views under aptitude</h3>
              </div>
            </div>
          </div>
          <p>In the interactive full screen mode of <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span>, packages in the package list are displayed as the next example.</p>
          <pre class="screen">idA   libsmbclient                             -2220kB 3.0.25a-1  3.0.25a-2</pre>
          <p>Here, this line means from the left as the following.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The "current state" flag (the first letter)
</p>
              </li>
              <li class="listitem">
                <p>
The "planned action" flag (the second letter)
</p>
              </li>
              <li class="listitem">
                <p>
The "automatic" flag (the  third letter)
</p>
              </li>
              <li class="listitem">
                <p>
The Package name
</p>
              </li>
              <li class="listitem">
                <p>
The change in disk space usage attributed to "planned action"
</p>
              </li>
              <li class="listitem">
                <p>
The current version of the package
</p>
              </li>
              <li class="listitem">
                <p>
The candidate version of the package
</p>
              </li>
            </ul>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The full list of flags are given at the bottom of <span class="strong"><strong>Help</strong></span> screen shown by pressing "<code class="literal">?</code>".</p>
                </td>
              </tr>
            </table>
          </div>
          <p>The <span class="strong"><strong>candidate version</strong></span> is chosen according to the current local preferences (see <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span> and <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a>).</p>
          <p>Several types of package views are available under the menu "<code class="literal">Views</code>".</p>
          <div class="table">
            <a id="listofviewsforaptitude"/>
            <p class="title">
              <strong>Table 2.9. List of views for aptitude</strong>
            </p>
            <div class="table-contents">
              <table summary="List of views for aptitude" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    view
    </th>
                    <th style="text-align: left">
    status
    </th>
                    <th style="text-align: left">
    description of view
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Package View</code>
                </td>
                    <td style="text-align: left">
    Good
    </td>
                    <td style="text-align: left">
    see <a class="xref" href="ch02.en.html#standard-package-views" title="Table 2.10. The categorization of standard package views">Table 2.10, “The categorization of standard package views”</a> (default)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Audit Recommendations</code>
                </td>
                    <td style="text-align: left">
    Good
    </td>
                    <td style="text-align: left">
    list packages which are recommended by some installed packages but not yet installed
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Flat Package List</code>
                </td>
                    <td style="text-align: left">
    Good
    </td>
                    <td style="text-align: left">
    list packages without categorization (for use with regex)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Debtags Browser</code>
                </td>
                    <td style="text-align: left">
    Very usable
    </td>
                    <td style="text-align: left">
    list packages categorized according to their <a class="ulink" href="http://debtags.alioth.debian.org/">debtags</a> entries
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Categorical Browser</code>
                </td>
                    <td style="text-align: left">
    Deprecated
    </td>
                    <td style="text-align: left">
    list packages categorized according to their category (use <code class="literal">Debtags Browser</code>, instead)
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Please help us <a class="ulink" href="http://debtags.alioth.debian.org/todo.html">improving tagging packages with debtags!</a></p>
                </td>
              </tr>
            </table>
          </div>
          <p>The standard "<code class="literal">Package View</code>" categorizes packages somewhat like <code class="literal">dselect</code> with few extra features.</p>
          <div class="table">
            <a id="standard-package-views"/>
            <p class="title">
              <strong>Table 2.10. The categorization of standard package views</strong>
            </p>
            <div class="table-contents">
              <table summary="The categorization of standard package views" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    category
    </th>
                    <th style="text-align: left">
    description of view
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Upgradable Packages</code>
                </td>
                    <td style="text-align: left">
    list packages organized as <code class="literal">section</code><code class="literal">area</code><code class="literal">package</code>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">New Packages</code>
                </td>
                    <td style="text-align: left">
    , ,
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Installed Packages</code>
                </td>
                    <td style="text-align: left">
    , ,
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Not Installed Packages</code>
                </td>
                    <td style="text-align: left">
    , ,
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Obsolete and Locally Created Packages</code>
                </td>
                    <td style="text-align: left">
    , ,
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Virtual Packages</code>
                </td>
                    <td style="text-align: left">
    list packages with the same function
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Tasks</code>
                </td>
                    <td style="text-align: left">
    list packages with different functions generally needed for a task
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p><code class="literal">Tasks</code> view can be used to cherry pick packages for your task.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_search_method_options_with_aptitude"/>2.2.6. Search method options with aptitude</h3>
              </div>
            </div>
          </div>
          <p>Aptitude offers several options for you to search packages using its regex formula.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Shell commandline:
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
"<code class="literal">aptitude search '&lt;aptitude_regex&gt;'</code>" to list installation status, package name and short description of matching packages
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">aptitude show '&lt;package_name&gt;'</code>" to list detailed description of the package
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
Interactive full screen mode:
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
"<code class="literal">l</code>" to limit package view to matching packages
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">/</code>" for search to a matching package
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">\</code>" for backward search to a matching package
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">n</code>" for find-next
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">N</code>" for find-next (backward)
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The string for &lt;package_name&gt; is treated as the exact string match to the package name unless it is started explicitly with "<code class="literal">~</code>" to be the regex formula.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_aptitude_regex_formula"/>2.2.7. The aptitude regex formula</h3>
              </div>
            </div>
          </div>
          <p>The aptitude regex formula is mutt-like extended <span class="strong"><strong>ERE</strong></span> (see <a class="xref" href="ch01.en.html#_regular_expressions" title="1.6.2. Regular expressions">Section 1.6.2, “Regular expressions”</a>) and the meanings of the <code class="literal">aptitude</code> specific special match rule extensions are as follows.</p>
          <div class="table">
            <a id="listoftheaptituderegexformula"/>
            <p class="title">
              <strong>Table 2.11. List of the aptitude regex formula</strong>
            </p>
            <div class="table-contents">
              <table summary="List of the aptitude regex formula" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    description of the extended match rule
    </th>
                    <th style="text-align: left">
    regex formula
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
    match on package name
    </td>
                    <td style="text-align: left">
                  <code class="literal">~n&lt;regex_name&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on description
    </td>
                    <td style="text-align: left">
                  <code class="literal">~d&lt;regex_description&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on task name
    </td>
                    <td style="text-align: left">
                  <code class="literal">~t&lt;regex_task&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on debtag
    </td>
                    <td style="text-align: left">
                  <code class="literal">~G&lt;regex_debtag&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on maintainer
    </td>
                    <td style="text-align: left">
                  <code class="literal">~m&lt;regex_maintainer&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on package section
    </td>
                    <td style="text-align: left">
                  <code class="literal">~s&lt;regex_section&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match on package version
    </td>
                    <td style="text-align: left">
                  <code class="literal">~V&lt;regex_version&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match archive
    </td>
                    <td style="text-align: left"><code class="literal">~A{jessie,stretch,sid</code>}
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match origin
    </td>
                    <td style="text-align: left"><code class="literal">~O{debian,…</code>}
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match priority
    </td>
                    <td style="text-align: left"><code class="literal">~p{extra,important,optional,required,standard</code>}
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match essential packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~E</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match virtual packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~v</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match new packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~N</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match with pending action
    </td>
                    <td style="text-align: left"><code class="literal">~a{install,upgrade,downgrade,remove,purge,hold,keep</code>}
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match installed packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~i</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match installed packages with <span class="strong"><strong>A</strong></span>-mark (auto installed packages)
    </td>
                    <td style="text-align: left">
                  <code class="literal">~M</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match installed packages without <span class="strong"><strong>A</strong></span>-mark (administrator selected packages)
    </td>
                    <td style="text-align: left">
                  <code class="literal">~i!~M</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match installed and upgradable packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~U</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match removed but not purged packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~c</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match removed, purged or can-be-removed packages
    </td>
                    <td style="text-align: left">
                  <code class="literal">~g</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages declaring a broken dependency
    </td>
                    <td style="text-align: left">
                  <code class="literal">~b</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages declaring broken dependency of &lt;type&gt;
    </td>
                    <td style="text-align: left">
                  <code class="literal">~B&lt;type&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match &lt;pattern&gt; packages declaring dependency of &lt;type&gt;
    </td>
                    <td style="text-align: left">
                  <code class="literal">~D[&lt;type&gt;:]&lt;pattern&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match &lt;pattern&gt; packages declaring broken dependency of &lt;type&gt;
    </td>
                    <td style="text-align: left">
                  <code class="literal">~DB[&lt;type&gt;:]&lt;pattern&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages to which the &lt;pattern&gt; matching package declares dependency &lt;type&gt;
    </td>
                    <td style="text-align: left">
                  <code class="literal">~R[&lt;type&gt;:]&lt;pattern&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages to which the &lt;pattern&gt; matching package declares broken dependency &lt;type&gt;
    </td>
                    <td style="text-align: left">
                  <code class="literal">~RB[&lt;type&gt;:]&lt;pattern&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages to which some other installed packages depend on
    </td>
                    <td style="text-align: left">
                  <code class="literal">~R~i</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages to which no other installed packages depend on
    </td>
                    <td style="text-align: left">
                  <code class="literal">!~R~i</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match packages to which some other installed packages depend or recommend on
    </td>
                    <td style="text-align: left">
                  <code class="literal">~R~i|~Rrecommends:~i</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match &lt;pattern&gt; package with filtered version
    </td>
                    <td style="text-align: left">
                  <code class="literal">~S filter &lt;pattern&gt;</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match all packages (true)
    </td>
                    <td style="text-align: left">
                  <code class="literal">~T</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    match no packages (false)
    </td>
                    <td style="text-align: left">
                  <code class="literal">~F</code>
                </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The regex part is the same <span class="strong"><strong>ERE</strong></span> as the one used in typical Unix-like text tools using "<code class="literal">^</code>", "<code class="literal">.*</code>", "<code class="literal">$</code>" etc. as in <span class="citerefentry"><span class="refentrytitle">egrep</span>(1)</span>, <span class="citerefentry"><span class="refentrytitle">awk</span>(1)</span> and <span class="citerefentry"><span class="refentrytitle">perl</span>(1)</span>.
</p>
              </li>
              <li class="listitem">
                <p>
The dependency &lt;type&gt; is one of (depends, predepends, recommends, suggests, conflicts, replaces, provides) specifying the package interrelationship.
</p>
              </li>
              <li class="listitem">
                <p>
The default dependency &lt;type&gt; is "depends".
</p>
              </li>
            </ul>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When &lt;regex_pattern&gt; is a null string, place "<code class="literal">~T</code>" immediately after the command.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Here are some short cuts.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"<code class="literal">~P&lt;term&gt;</code>" == "<code class="literal">~Dprovides:&lt;term&gt;</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">~C&lt;term&gt;</code>" == "<code class="literal">~Dconflicts:&lt;term&gt;</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">…~W term</code>" == "<code class="literal">(…|term)</code>"
</p>
              </li>
            </ul>
          </div>
          <p>Users familiar with <code class="literal">mutt</code> pick up quickly, as mutt was the inspiration for the expression syntax. See "SEARCHING, LIMITING, AND EXPRESSIONS" in the "User's Manual" "<code class="literal">/usr/share/doc/aptitude/README</code>".</p>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>With the <code class="literal">lenny</code> version of <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span>, the new <span class="strong"><strong>long form</strong></span> syntax such as "<code class="literal">?broken</code>" may be used for regex matching in place for its old <span class="strong"><strong>short form</strong></span> equivalent "<code class="literal">~b</code>". Now space character "<code class="literal"> </code>" is considered as one of the regex terminating character in addition to tilde character "<code class="literal">~</code>".  See "User's Manual" for the new <span class="strong"><strong>long form</strong></span> syntax.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_dependency_resolution_of_aptitude"/>2.2.8. Dependency resolution of aptitude</h3>
              </div>
            </div>
          </div>
          <p>The selection of a package in <code class="literal">aptitude</code> not only pulls in packages which are defined in its "<code class="literal">Depends:</code>" list but also defined in the "<code class="literal">Recommends:</code>" list if the menu "<code class="literal">F10</code> → Options → Preferences → Dependency handling" is set accordingly.  These auto installed packages are removed automatically if they are no longer needed under <code class="literal">aptitude</code>.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_package_activity_logs"/>2.2.9. Package activity logs</h3>
              </div>
            </div>
          </div>
          <p>You can check package activity history in the log files.</p>
          <div class="table">
            <a id="thelogfilesforpackageactivities"/>
            <p class="title">
              <strong>Table 2.12. The log files for package activities</strong>
            </p>
            <div class="table-contents">
              <table summary="The log files for package activities" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    file
    </th>
                    <th style="text-align: left">
    content
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/log/dpkg.log</code>
                </td>
                    <td style="text-align: left">
    Log of <code class="literal">dpkg</code> level activity for all package activities
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/log/apt/term.log</code>
                </td>
                    <td style="text-align: left">
    Log of generic APT activity
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/log/aptitude</code>
                </td>
                    <td style="text-align: left">
    Log of <code class="literal">aptitude</code> command activity
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>In reality, it is not so easy to get meaningful understanding quickly out from these logs.  See <a class="xref" href="ch09.en.html#_recording_changes_in_configuration_files" title="9.2.10. Recording changes in configuration files">Section 9.2.10, “Recording changes in configuration files”</a> for easier way.</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_examples_of_aptitude_operations"/>2.3. Examples of aptitude operations</h2>
            </div>
          </div>
        </div>
        <p>Here are few examples of <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> operations.</p>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_listing_packages_with_regex_matching_on_package_names"/>2.3.1. Listing packages with regex matching on package names</h3>
              </div>
            </div>
          </div>
          <p>The following command lists packages with regex matching on package names.</p>
          <pre class="screen">$ aptitude search '~n(pam|nss).*ldap'
p libnss-ldap - NSS module for using LDAP as a naming service
p libpam-ldap - Pluggable Authentication Module allowing LDAP interfaces</pre>
          <p>This is quite handy for you to find the exact name of a package.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_browsing_with_the_regex_matching"/>2.3.2. Browsing with the regex matching</h3>
              </div>
            </div>
          </div>
          <p>The regex "<code class="literal">~dipv6</code>" in the "New Flat Package List" view with "<code class="literal">l</code>" prompt, limits view to packages with the matching description and let you browse their information interactively.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_purging_removed_packages_for_good"/>2.3.3. Purging removed packages for good</h3>
              </div>
            </div>
          </div>
          <p>You can purge all remaining configuration files of removed packages.</p>
          <p>Check results of the following command.</p>
          <pre class="screen"># aptitude search '~c'</pre>
          <p>If you think listed packages are OK to be purged, execute the following command.</p>
          <pre class="screen"># aptitude purge '~c'</pre>
          <p>You may want to do the similar in the interactive mode for fine grained control.</p>
          <p>You provide the regex "<code class="literal">~c</code>" in the "New Package View" view with "<code class="literal">l</code>" prompt.  This limits the package view only to regex matched packages, i.e., "removed but not purged".  All these regex matched packages can be shown by pressing "<code class="literal">[</code>" at top level headings.</p>
          <p>Then you press "<code class="literal">_</code>" at top level headings such as "Not Installed Packages".  Only regex matched packages under the heading are marked to be purged by this.  You can exclude some packages to be purged by pressing "<code class="literal">=</code>" interactively for each of them.</p>
          <p>This technique is quite handy and works for many other command keys.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_tidying_auto_manual_install_status"/>2.3.4. Tidying auto/manual install status</h3>
              </div>
            </div>
          </div>
          <p>Here is how I tidy auto/manual install status for packages (after using non-aptitude package installer etc.).</p>
          <div class="orderedlist">
            <ol class="orderedlist">
              <li class="listitem">
                <p>
Start <code class="literal">aptitude</code> in interactive mode as root.
</p>
              </li>
              <li class="listitem">
                <p>
Type "<code class="literal">u</code>", "<code class="literal">U</code>", "<code class="literal">f</code>" and "<code class="literal">g</code>" to update and upgrade package list and packages.
</p>
              </li>
              <li class="listitem">
                <p>
Type "<code class="literal">l</code>" to enter the package display limit as "<code class="literal">~i(~R~i|~Rrecommends:~i)</code>" and type "<code class="literal">M</code>" over "<code class="literal">Installed Packages</code>" as auto installed.
</p>
              </li>
              <li class="listitem">
                <p>
Type "<code class="literal">l</code>" to enter the package display limit as "<code class="literal">~prequired|~pimportant|~pstandard|~E</code>" and type "<code class="literal">m</code>" over "<code class="literal">Installed Packages</code>" as manual installed.
</p>
              </li>
              <li class="listitem">
                <p>
Type "<code class="literal">l</code>" to enter the package display limit as "<code class="literal">~i!~M</code>" and remove unused package by typing "<code class="literal">-</code>" over each of them after exposing them by typing "<code class="literal">[</code>" over "<code class="literal">Installed Packages</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Type "<code class="literal">l</code>", to enter the package display limit as "<code class="literal">~i</code>"; then type "<code class="literal">m</code>" over "<code class="literal">Tasks</code>", to mark that packages as manual installed.
</p>
              </li>
              <li class="listitem">
                <p>
Exit <code class="literal">aptitude</code>.
</p>
              </li>
              <li class="listitem">
                <p>
Start "<code class="literal">apt-get -s autoremove|less</code>" as root to check what are not used.
</p>
              </li>
              <li class="listitem">
                <p>
Restart <code class="literal">aptitude</code> in interactive mode and mark needed packages as "<code class="literal">m</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Restart "<code class="literal">apt-get -s autoremove|less</code>" as root to recheck REMOVED contain only expected packages.
</p>
              </li>
              <li class="listitem">
                <p>
Start "<code class="literal">apt-get autoremove|less</code>" as root to autoremove unused packages.
</p>
              </li>
            </ol>
          </div>
          <p>The "<code class="literal">m</code>" action over "<code class="literal">Tasks</code>" is an optional one to prevent mass package removal situation in future.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_system_wide_upgrade"/>2.3.5. System wide upgrade</h3>
              </div>
            </div>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When moving to a new release etc, you should consider to perform a clean installation of new system even though Debian is upgradable as described below.  This provides you a chance to remove garbages collected and exposes you to the best combination of latest packages.  Of course, you should make a full backup of system to a safe place (see <a class="xref" href="ch10.en.html#_backup_and_recovery" title="10.2. Backup and recovery">Section 10.2, “Backup and recovery”</a>) before doing this. I recommend to make a dual boot configuration using different partition to have the smoothest transition.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>You can perform system wide upgrade to a newer release by changing contents of the "<code class="literal">/etc/apt/sources.list</code>" file pointing to a new release and running the "<code class="literal">apt-get update; apt-get dist-upgrade</code>" command.</p>
          <p>To upgrade from <code class="literal">stable</code> to <code class="literal">testing</code> or <code class="literal">unstable</code>, you replace "<code class="literal">jessie</code>" in the "<code class="literal">/etc/apt/sources.list</code>" example of <a class="xref" href="ch02.en.html#_debian_archive_basics" title="2.1.4. Debian archive basics">Section 2.1.4, “Debian archive basics”</a> with "<code class="literal">stretch</code>" or "<code class="literal">sid</code>".</p>
          <p>In reality, you may face some complications due to some package transition issues, mostly due to package dependencies.  The larger the difference of the upgrade, the more likely you face larger troubles.  For the transition from the old <code class="literal">stable</code> to the new <code class="literal">stable</code> after its release, you can read its new <a class="ulink" href="http://www.debian.org/releases/stable/releasenotes">Release Notes</a> and follow the exact procedure described in it to minimize troubles.</p>
          <p>When you decide to move from <code class="literal">stable</code> to <code class="literal">testing</code> before its formal release, there are no <a class="ulink" href="http://www.debian.org/releases/stable/releasenotes">Release Notes</a> to help you. The difference between <code class="literal">stable</code> and <code class="literal">testing</code> could have grown quite large after the previous <code class="literal">stable</code> release and makes upgrade situation complicated.</p>
          <p>You should make precautionary moves for the full upgrade while gathering latest information from mailing list and using common senses.</p>
          <div class="orderedlist">
            <ol class="orderedlist">
              <li class="listitem">
                <p>
Read previous "Release Notes".
</p>
              </li>
              <li class="listitem">
                <p>
Backup entire system (especially data and configuration information).
</p>
              </li>
              <li class="listitem">
                <p>
Have bootable media handy for broken bootloader.
</p>
              </li>
              <li class="listitem">
                <p>
Inform users on the system well in advance.
</p>
              </li>
              <li class="listitem">
                <p>
Record upgrade activity with <span class="citerefentry"><span class="refentrytitle">script</span>(1)</span>.
</p>
              </li>
              <li class="listitem">
                <p>
Apply "unmarkauto" to required packages, e.g., "<code class="literal">aptitude unmarkauto vim</code>", to prevent removal.
</p>
              </li>
              <li class="listitem">
                <p>
Minimize installed packages to reduce chance of package conflicts, e.g., remove desktop task packages.
</p>
              </li>
              <li class="listitem">
                <p>
Remove the "<code class="literal">/etc/apt/preferences</code>" file (disable apt-pinning).
</p>
              </li>
              <li class="listitem">
                <p>
Try to upgrade step wise: <code class="literal">oldstable</code><code class="literal">stable</code><code class="literal">testing</code><code class="literal">unstable</code>.
</p>
              </li>
              <li class="listitem">
                <p>
Update the "<code class="literal">/etc/apt/sources.list</code>" file to point to new archive only and run "<code class="literal">aptitude update</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Install, optionally, new <span class="strong"><strong>core packages</strong></span> first, e.g., "<code class="literal">aptitude install perl</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Run the "<code class="literal">apt-get -s dist-upgrade</code>" command to assess impact.
</p>
              </li>
              <li class="listitem">
                <p>
Run the "<code class="literal">apt-get dist-upgrade</code>" command at last.
</p>
              </li>
            </ol>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>It is not wise to skip major Debian release when upgrading between <code class="literal">stable</code> releases.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>In previous "Release Notes", GCC, Linux Kernel, initrd-tools, Glibc, Perl, APT tool chain, etc. have required some special attention for system wide upgrade.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>For daily upgrade in <code class="literal">unstable</code>, see <a class="xref" href="ch02.en.html#_safeguarding_for_package_problems" title="2.4.3. Safeguarding for package problems">Section 2.4.3, “Safeguarding for package problems”</a>.</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_advanced_package_management_operations"/>2.4. Advanced package management operations</h2>
            </div>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_advanced_package_management_operations_with_commandline"/>2.4.1. Advanced package management operations with commandline</h3>
              </div>
            </div>
          </div>
          <p>Here are list of other package management operations for which <code class="literal">aptitude</code> is too high-level or lacks required functionalities.</p>
          <div class="table">
            <a id="listofadvancedpagementoperations"/>
            <p class="title">
              <strong>Table 2.13. List of advanced package management operations</strong>
            </p>
            <div class="table-contents">
              <table summary="List of advanced package management operations" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    command
    </th>
                    <th style="text-align: left">
    action
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">COLUMNS=120 dpkg -l &lt;package_name_pattern&gt;</code>
                </td>
                    <td style="text-align: left">
    list status of an installed package for the bug report
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg -L &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    list contents of an installed package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg -L &lt;package_name&gt; | egrep '/usr/share/man/man.*/.+'</code>
                </td>
                    <td style="text-align: left">
    list manpages for an installed package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg -S &lt;file_name_pattern&gt;</code>
                </td>
                    <td style="text-align: left">
    list installed packages which have matching file name
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-file search &lt;file_name_pattern&gt;</code>
                </td>
                    <td style="text-align: left">
    list packages in archive which have matching file name
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-file list &lt;package_name_pattern&gt;</code>
                </td>
                    <td style="text-align: left">
    list contents of matching packages in archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg-reconfigure &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    reconfigure the exact package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg-reconfigure -p=low &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    reconfigure the exact package with the most detailed question
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">configure-debian</code>
                </td>
                    <td style="text-align: left">
    reconfigure packages from the full screen menu
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg --audit</code>
                </td>
                    <td style="text-align: left">
    audit system for partially installed packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg --configure -a</code>
                </td>
                    <td style="text-align: left">
    configure all partially installed packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-cache policy &lt;binary_package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    show available version, priority, and archive information of a binary package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-cache madison &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    show available version, archive information of a package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-cache showsrc &lt;binary_package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    show source package information of a binary package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-get build-dep &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    install required packages to build package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">aptitude build-dep &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    install required packages to build package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">apt-get source &lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    download a source (from standard archive)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dget &lt;URL for dsc file&gt;</code>
                </td>
                    <td style="text-align: left">
    download a source packages (from other archive)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg-source -x &lt;package_name&gt;_&lt;version&gt;-&lt;debian_version&gt;.dsc</code>
                </td>
                    <td style="text-align: left">
    build a source tree from a set of source packages ("<code class="literal">*.orig.tar.gz</code>" and "<code class="literal">*.debian.tar.gz</code>"/"<code class="literal">*.diff.gz</code>")
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">debuild binary</code>
                </td>
                    <td style="text-align: left">
    build package(s) from a local source tree
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">make-kpkg kernel_image</code>
                </td>
                    <td style="text-align: left">
    build a kernel package from a kernel source tree
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">make-kpkg --initrd kernel_image</code>
                </td>
                    <td style="text-align: left">
    build a kernel package from a kernel source tree with initramfs enabled
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg -i &lt;package_name&gt;_&lt;version&gt;-&lt;debian_version&gt;_&lt;arch&gt;.deb</code>
                </td>
                    <td style="text-align: left">
    install a local package to the system
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">debi &lt;package_name&gt;_&lt;version&gt;-&lt;debian_version&gt;_&lt;arch&gt;.dsc</code>
                </td>
                    <td style="text-align: left">
    install local package(s) to the system
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg --get-selections '*' &gt;selection.txt</code>
                </td>
                    <td style="text-align: left">
    save <code class="literal">dpkg</code> level package selection state information
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">dpkg --set-selections &lt;selection.txt</code>
                </td>
                    <td style="text-align: left">
    set <code class="literal">dpkg</code> level package selection state information
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">echo &lt;package_name&gt; hold | dpkg --set-selections</code>
                </td>
                    <td style="text-align: left">
    set <code class="literal">dpkg</code> level package selection state for a package to <span class="strong"><strong>hold</strong></span>  (equivalent to "<code class="literal">aptitude hold &lt;package_name&gt;</code>")
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>For a package with the <a class="ulink" href="https://wiki.debian.org/Multiarch">multi-arch</a> feature, you may need to specify the architecture name for some commands.  For example, use "<code class="literal">dpkg -L libglib2.0-0:amd64</code>" to list contents of the <code class="literal">libglib2.0-0</code> package for the <code class="literal">amd64</code> architecture.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Lower level package tools such as "<code class="literal">dpkg -i …</code>" and "<code class="literal">debi …</code>" should be carefully used by the system administrator.  It does not automatically take care required package dependencies. Dpkg's commandline options "<code class="literal">--force-all</code>" and similar (see <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span>) are intended to be used by experts only.  Using them without fully understanding their effects may break your whole system.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Please note the following.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
All system configuration and installation commands require to be run from root.
</p>
              </li>
              <li class="listitem">
                <p>
Unlike <code class="literal">aptitude</code> which uses regex (see <a class="xref" href="ch01.en.html#_regular_expressions" title="1.6.2. Regular expressions">Section 1.6.2, “Regular expressions”</a>), other package management commands use pattern like shell glob (see <a class="xref" href="ch01.en.html#_shell_glob" title="1.5.6. Shell glob">Section 1.5.6, “Shell glob”</a>).
</p>
              </li>
              <li class="listitem">
                <p><span class="citerefentry"><span class="refentrytitle">apt-file</span>(1)</span> provided by the <code class="literal">apt-file</code> package must run "<code class="literal">apt-file update</code>" in advance.
</p>
              </li>
              <li class="listitem">
                <p><span class="citerefentry"><span class="refentrytitle">configure-debian</span>(8)</span> provided by the <code class="literal">configure-debian</code> package runs <span class="citerefentry"><span class="refentrytitle">dpkg-reconfigure</span>(8)</span> as its backend.
</p>
              </li>
              <li class="listitem">
                <p><span class="citerefentry"><span class="refentrytitle">dpkg-reconfigure</span>(8)</span> runs package scripts using <span class="citerefentry"><span class="refentrytitle">debconf</span>(1)</span> as its backend.
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">apt-get build-dep</code>", "<code class="literal">apt-get source</code>" and "<code class="literal">apt-cache showsrc</code>" commands require "<code class="literal">deb-src</code>" entry in "<code class="literal">/etc/apt/sources.list</code>".
</p>
              </li>
              <li class="listitem">
                <p><span class="citerefentry"><span class="refentrytitle">dget</span>(1)</span>, <span class="citerefentry"><span class="refentrytitle">debuild</span>(1)</span>, and <span class="citerefentry"><span class="refentrytitle">debi</span>(1)</span> require <code class="literal">devscripts</code> package.
</p>
              </li>
              <li class="listitem">
                <p>
See (re)packaging procedure using "<code class="literal">apt-get source</code>" in <a class="xref" href="ch02.en.html#_porting_a_package_to_the_stable_system" title="2.7.13. Porting a package to the stable system">Section 2.7.13, “Porting a package to the stable system”</a>.
</p>
              </li>
              <li class="listitem">
                <p><code class="literal">make-kpkg</code> command requires the <code class="literal">kernel-package</code> package (see <a class="xref" href="ch09.en.html#_the_kernel" title="9.9. The kernel">Section 9.9, “The kernel”</a>).
</p>
              </li>
              <li class="listitem">
                <p>
See <a class="xref" href="ch12.en.html#_making_debian_package" title="12.11. Making Debian package">Section 12.11, “Making Debian package”</a> for general packaging.
</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_verification_of_installed_package_files"/>2.4.2. Verification of installed package files</h3>
              </div>
            </div>
          </div>
          <p>The installation of <code class="literal">debsums</code> enables verification of installed package files against MD5sum values in the "<code class="literal">/var/lib/dpkg/info/*.md5sums</code>" file with <span class="citerefentry"><span class="refentrytitle">debsums</span>(1)</span>.  See <a class="xref" href="ch10.en.html#_the_md5_sum" title="10.3.5. The MD5 sum">Section 10.3.5, “The MD5 sum”</a> for how MD5sum works.</p>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Because MD5sum database may be tampered by the intruder, <span class="citerefentry"><span class="refentrytitle">debsums</span>(1)</span> is of limited use as a security tool. It is only good for checking local modifications by the administrator or damage due to media errors.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_safeguarding_for_package_problems"/>2.4.3. Safeguarding for package problems</h3>
              </div>
            </div>
          </div>
          <p>Many users prefer to follow the <span class="strong"><strong>unstable</strong></span> release of the Debian system for its new features and packages.  This makes the system more prone to be hit by the critical package bugs.</p>
          <p>The installation of the <code class="literal">apt-listbugs</code> package safeguards your system against critical bugs by checking Debian BTS automatically for critical bugs when upgrading with APT system.</p>
          <p>The installation of the <code class="literal">apt-listchanges</code> package provides important news in "<code class="literal">NEWS.Debian</code>" when upgrading with APT system.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_searching_on_the_package_meta_data"/>2.4.4. Searching on the package meta data</h3>
              </div>
            </div>
          </div>
          <p>Although visiting Debian site <a class="ulink" href="http://packages.debian.org/">http://packages.debian.org/</a> facilitates easy ways to search on the package meta data these days, let's look into more traditional ways.</p>
          <p>The <span class="citerefentry"><span class="refentrytitle">grep-dctrl</span>(1)</span>, <span class="citerefentry"><span class="refentrytitle">grep-status</span>(1)</span>, and <span class="citerefentry"><span class="refentrytitle">grep-available</span>(1)</span> commands can be used to search any file which has the general format of a Debian package control file.</p>
          <p>The "<code class="literal">dpkg -S &lt;file_name_pattern&gt;</code>" can be used search package names which contain files with the matching name installed by <code class="literal">dpkg</code>.  But this overlooks files created by the maintainer scripts.</p>
          <p>If you need to make more elaborate search on the dpkg meta data, you need to run "<code class="literal">grep -e regex_pattern *</code>" command in the "<code class="literal">/var/lib/dpkg/info/</code>" directory.  This makes you search words mentioned in package scripts and installation query texts.</p>
          <p>If you wish to look up package dependency recursively, you should use <span class="citerefentry"><span class="refentrytitle">apt-rdepends</span>(8)</span>.</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_debian_package_management_internals"/>2.5. Debian package management internals</h2>
            </div>
          </div>
        </div>
        <p>Let's learn how the Debian package management system works internally.  This should help you to create your own solution to some package problems.</p>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_archive_meta_data"/>2.5.1. Archive meta data</h3>
              </div>
            </div>
          </div>
          <p>Meta data files for each distribution are stored under "<code class="literal">dist/&lt;codename&gt;</code>" on each Debian mirror sites, e.g., "<code class="literal">http://ftp.us.debian.org/debian/</code>".  Its archive structure can be browsed by the web browser. There are 6 types of key meta data.</p>
          <div class="table">
            <a id="thecontentofthednarchivemetadata"/>
            <p class="title">
              <strong>Table 2.14. The content of the Debian archive meta data</strong>
            </p>
            <div class="table-contents">
              <table summary="The content of the Debian archive meta data" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    file
    </th>
                    <th style="text-align: left">
    location
    </th>
                    <th style="text-align: left">
    content
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Release</code>
                </td>
                    <td style="text-align: left">
    top of distribution
    </td>
                    <td style="text-align: left">
    archive description and integrity information
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Release.gpg</code>
                </td>
                    <td style="text-align: left">
    top of distribution
    </td>
                    <td style="text-align: left">
    signature file for the "<code class="literal">Release</code>" file signed with the archive key
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Contents-&lt;architecture&gt;</code>
                </td>
                    <td style="text-align: left">
    top of distribution
    </td>
                    <td style="text-align: left">
    list of all files for all the packages in the pertinent archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Release</code>
                </td>
                    <td style="text-align: left">
    top of each distribution/area/architecture combination
    </td>
                    <td style="text-align: left">
    archive description used for the rule of <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Packages</code>
                </td>
                    <td style="text-align: left">
    top of each distribution/area/binary-architecture combination
    </td>
                    <td style="text-align: left">
    concatenated <code class="literal">debian/control</code> for binary packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">Sources</code>
                </td>
                    <td style="text-align: left">
    top of each distribution/area/source combination
    </td>
                    <td style="text-align: left">
    concatenated <code class="literal">debian/control</code> for source packages
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>In the recent archive, these meta data are stored as the compressed and differential files to reduce network traffic.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_top_level_release_file_and_authenticity"/>2.5.2. Top level "Release" file and authenticity</h3>
              </div>
            </div>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The top level "<code class="literal">Release</code>" file is used for signing the archive under the <span class="strong"><strong>secure APT</strong></span> system.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Each suite of the Debian archive has a top level "<code class="literal">Release</code>" file, e.g., "<code class="literal">http://ftp.us.debian.org/debian/dists/unstable/Release</code>", as follows.</p>
          <pre class="screen">Origin: Debian
Label: Debian
Suite: unstable
Codename: sid
Date: Sat, 14 May 2011 08:20:50 UTC
Valid-Until: Sat, 21 May 2011 08:20:50 UTC
Architectures: alpha amd64 armel hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 sparc
Components: main contrib non-free
Description: Debian x.y Unstable - Not Released
MD5Sum:
 bdc8fa4b3f5e4a715dd0d56d176fc789 18876880 Contents-alpha.gz
 9469a03c94b85e010d116aeeab9614c0 19441880 Contents-amd64.gz
 3d68e206d7faa3aded660dc0996054fe 19203165 Contents-armel.gz
...</pre>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Here, you can find my rationale to use the "suite", and "codename" in <a class="xref" href="ch02.en.html#_debian_archive_basics" title="2.1.4. Debian archive basics">Section 2.1.4, “Debian archive basics”</a>.  The "distribution" is used when referring to both "suite" and "codename".  All archive "area" names offered by the archive are listed under "Components".</p>
                </td>
              </tr>
            </table>
          </div>
          <p>The integrity of the top level "<code class="literal">Release</code>" file is verified by cryptographic infrastructure called the <a class="ulink" href="http://wiki.debian.org/SecureApt">secure apt</a>.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
The cryptographic signature file "<code class="literal">Release.gpg</code>" is created from the authentic top level "<code class="literal">Release</code>" file and the secret Debian archive key.
</p>
              </li>
              <li class="listitem">
                <p>
The public Debian archive key can be seeded into "<code class="literal">/etc/apt/trusted.gpg</code>";
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
automatically by installing the keyring with the latest <code class="literal">base-files</code> package, or
</p>
                    </li>
                    <li class="listitem">
                      <p>
manually by <code class="literal">gpg</code> or <code class="literal">apt-key</code> tool with <a class="ulink" href="http://ftp-master.debian.org/">the latest public archive key posted on the ftp-master.debian.org</a> .
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
The <span class="strong"><strong>secure APT</strong></span> system verifies the integrity of the downloaded top level "<code class="literal">Release</code>" file cryptographically by this "<code class="literal">Release.gpg</code>" file and the public Debian archive key in "<code class="literal">/etc/apt/trusted.gpg</code>".
</p>
              </li>
            </ul>
          </div>
          <p>The integrity of all the "<code class="literal">Packages</code>" and "<code class="literal">Sources</code>" files are verified by using MD5sum values in its top level "<code class="literal">Release</code>" file.  The integrity of all package files are verified by using MD5sum values in the "<code class="literal">Packages</code>" and "<code class="literal">Sources</code>" files.  See <span class="citerefentry"><span class="refentrytitle">debsums</span>(1)</span> and <a class="xref" href="ch02.en.html#_verification_of_installed_package_files" title="2.4.2. Verification of installed package files">Section 2.4.2, “Verification of installed package files”</a>.</p>
          <p>Since the cryptographic signature verification is a much more CPU intensive process than the MD5sum value calculation, use of MD5sum value for each package while using cryptographic signature for the top level "<code class="literal">Release</code>" file provides <a class="ulink" href="http://www.infodrom.org/~joey/Writing/Linux-Journal/secure-apt/">the good security with the performance</a> (see <a class="xref" href="ch10.en.html#_data_security_infrastructure" title="10.3. Data security infrastructure">Section 10.3, “Data security infrastructure”</a>).</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_archive_level_release_files"/>2.5.3. Archive level "Release" files</h3>
              </div>
            </div>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The archive level "<code class="literal">Release</code>" files are used for the rule of <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span>.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>There are archive level "<code class="literal">Release</code>" files for all archive locations specified by "<code class="literal">deb</code>" line in "<code class="literal">/etc/apt/sources.list</code>", such as "<code class="literal">http://ftp.us.debian.org/debian/dists/unstable/main/binary-amd64/Release</code>" or "<code class="literal">http://ftp.us.debian.org/debian/dists/sid/main/binary-amd64/Release</code>" as follows.</p>
          <pre class="screen">Archive: unstable
Origin: Debian
Label: Debian
Component: main
Architecture: amd64</pre>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>For "<code class="literal">Archive:</code>" stanza, suite names ("<code class="literal">stable</code>", "<code class="literal">testing</code>", "<code class="literal">unstable</code>", …) are used in <a class="ulink" href="http://ftp.us.debian.org/debian/">the Debian archive</a> while codenames ("<code class="literal">dapper</code>", "<code class="literal">feisty</code>", "<code class="literal">gutsy</code>", "<code class="literal">hardy</code>", "<code class="literal">intrepid</code>", …) are used in <a class="ulink" href="http://archive.ubuntu.com/ubuntu/">the Ubuntu archive</a>.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>For some archives, such as <code class="literal">experimental</code>, and <code class="literal">jessie-backports</code>, which contain packages which should not be installed automatically, there is an extra line, e.g., "<code class="literal">http://ftp.us.debian.org/debian/dists/experimental/main/binary-amd64/Release</code>" as follows.</p>
          <pre class="screen">Archive: experimental
Origin: Debian
Label: Debian
NotAutomatic: yes
Component: main
Architecture: amd64</pre>
          <p>Please note that for normal archives without "<code class="literal">NotAutomatic: yes</code>", the default Pin-Priority value is 500, while for special archives with "<code class="literal">NotAutomatic: yes</code>", the default Pin-Priority value is 1 (see <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span> and <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a>).</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_fetching_of_the_meta_data_for_the_package"/>2.5.4. Fetching of the meta data for the package</h3>
              </div>
            </div>
          </div>
          <p>When APT tools, such as <code class="literal">aptitude</code>, <code class="literal">apt-get</code>, <code class="literal">synaptic</code>, <code class="literal">apt-file</code>, <code class="literal">auto-apt</code>, … are used, we need to update the local copies of the meta data containing the Debian archive information. These local copies have following file names corresponding to the specified <code class="literal">distribution</code>, <code class="literal">area</code>, and <code class="literal">architecture</code> names in the "<code class="literal">/etc/apt/sources.list</code>" (see <a class="xref" href="ch02.en.html#_debian_archive_basics" title="2.1.4. Debian archive basics">Section 2.1.4, “Debian archive basics”</a>).</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/apt/lists/ftp.us.debian.org_debian_dists_&lt;distribution&gt;_Release</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/apt/lists/ftp.us.debian.org_debian_dists_&lt;distribution&gt;_Release.gpg</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/apt/lists/ftp.us.debian.org_debian_dists_&lt;distribution&gt;_&lt;area&gt;_binary-&lt;architecture&gt;_Packages</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/apt/lists/ftp.us.debian.org_debian_dists_&lt;distribution&gt;_&lt;area&gt;_source_Sources</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/cache/apt/apt-file/ftp.us.debian.org_debian_dists_&lt;distribution&gt;_Contents-&lt;architecture&gt;.gz</code>" (for <code class="literal">apt-file</code>)
</p>
              </li>
            </ul>
          </div>
          <p>First 4 types of files are shared by all the pertinent APT commands and updated from command line by "<code class="literal">apt-get update</code>" or "<code class="literal">aptitude update</code>".  The "<code class="literal">Packages</code>" meta data are updated if there is the "<code class="literal">deb</code>" line in "<code class="literal">/etc/apt/sources.list</code>". The "<code class="literal">Sources</code>" meta data are updated if there is the "<code class="literal">deb-src</code>" line in "<code class="literal">/etc/apt/sources.list</code>".</p>
          <p>The "<code class="literal">Packages</code>" and "<code class="literal">Sources</code>" meta data contain "<code class="literal">Filename:</code>" stanza pointing to the file location of the binary and source packages.  Currently, these packages are located under the "<code class="literal">pool/</code>" directory tree for the improved transition over the releases.</p>
          <p>Local copies of "<code class="literal">Packages</code>" meta data can be interactively searched with the help of <code class="literal">aptitude</code>.  The specialized search command <span class="citerefentry"><span class="refentrytitle">grep-dctrl</span>(1)</span> can search local copies of "<code class="literal">Packages</code>" and "<code class="literal">Sources</code>" meta data.</p>
          <p>Local copy of "<code class="literal">Contents-&lt;architecture&gt;</code>" meta data can be updated by "<code class="literal">apt-file update</code>" and its location is different from other 4 ones. See <span class="citerefentry"><span class="refentrytitle">apt-file</span>(1)</span>. (The <code class="literal">auto-apt</code> uses different location for local copy of "<code class="literal">Contents-&lt;architecture&gt;.gz</code>" as default.)</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_package_state_for_apt"/>2.5.5. The package state for APT</h3>
              </div>
            </div>
          </div>
          <p>In addition to the remotely fetched meta data, the APT tool after <code class="literal">lenny</code> stores its locally generated installation state information in the "<code class="literal">/var/lib/apt/extended_states</code>" which is used by all APT tools to track all auto installed packages.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_package_state_for_aptitude"/>2.5.6. The package state for aptitude</h3>
              </div>
            </div>
          </div>
          <p>In addition to the remotely fetched meta data, the <code class="literal">aptitude</code> command stores its locally generated installation state information in the "<code class="literal">/var/lib/aptitude/pkgstates</code>" which is used only by it.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_local_copies_of_the_fetched_packages"/>2.5.7. Local copies of the fetched packages</h3>
              </div>
            </div>
          </div>
          <p>All the remotely fetched packages via APT mechanism are stored in the "<code class="literal">/var/cache/apt/archives</code>" until they are cleaned.</p>
          <p>This cache file cleaning policy for <code class="literal">aptitude</code> can be set under "<code class="literal">Options</code>" → "<code class="literal">Preferences</code>" and it may be forced by its menu "<code class="literal">Clean package cache</code>" or "<code class="literal">Clean obsolete files</code>" under "<code class="literal">Actions</code>".</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_debian_package_file_names"/>2.5.8. Debian package file names</h3>
              </div>
            </div>
          </div>
          <p>Debian package files have particular name structures.</p>
          <div class="table">
            <a id="thenamestructureofdebianpackages"/>
            <p class="title">
              <strong>Table 2.15. The name structure of Debian packages</strong>
            </p>
            <div class="table-contents">
              <table summary="The name structure of Debian packages" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    package type
    </th>
                    <th style="text-align: left">
    name structure
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
    The binary package (a.k.a <code class="literal">deb</code>)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;-&lt;architecture&gt;.deb</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The binary package for debian-installer (a.k.a <code class="literal">udeb</code>)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;-&lt;architecture&gt;.udeb</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The source package (upstream source)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;.orig.tar.gz</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The <code class="literal">1.0</code> source package (Debian changes)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;.diff.gz</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The <code class="literal">3.0 (quilt)</code> source package (Debian changes)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;.debian.tar.gz</code>
                </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    The source package (description)
    </td>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;_&lt;epoch&gt;:&lt;upstream-version&gt;-&lt;debian.version&gt;.dsc</code>
                </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Here only the basic source package formats are described.  See more on <span class="citerefentry"><span class="refentrytitle">dpkg-source</span>(1)</span>.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="table">
            <a id="theusablecharactbianpackagenames"/>
            <p class="title">
              <strong>Table 2.16. The usable characters for each component in the Debian package names</strong>
            </p>
            <div class="table-contents">
              <table summary="The usable characters for each component in the Debian package names" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    name component
    </th>
                    <th style="text-align: left">
    usable characters (regex)
    </th>
                    <th style="text-align: left">
    existence
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">&lt;package-name&gt;</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">[a-z,A-Z,0-9,.,+,-]+</code>
                </td>
                    <td style="text-align: left">
    required
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">&lt;epoch&gt;:</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">[0-9]+:</code>
                </td>
                    <td style="text-align: left">
    optional
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">&lt;upstream-version&gt;</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">[a-z,A-Z,0-9,.,+,-,:]+</code>
                </td>
                    <td style="text-align: left">
    required
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">&lt;debian.version&gt;</code>
                </td>
                    <td style="text-align: left">
                  <code class="literal">[a-z,A-Z,0-9,.,+,~]+</code>
                </td>
                    <td style="text-align: left">
    optional
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>You can check package version order by <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span>, e.g., "<code class="literal">dpkg --compare-versions 7.0 gt 7.~pre1 ; echo $?</code>" .</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p><a class="ulink" href="http://www.debian.org/devel/debian-installer/">The debian-installer (d-i)</a> uses <code class="literal">udeb</code> as the file extension for its binary package instead of normal <code class="literal">deb</code>.  An <code class="literal">udeb</code> package is a stripped down <code class="literal">deb</code> package which removes few non-essential contents such as documentation to save space while relaxing the package policy requirements.  Both <code class="literal">deb</code> and <code class="literal">udeb</code> packages share the same package structure.  The "<code class="literal">u</code>" stands for micro.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_dpkg_command"/>2.5.9. The dpkg command</h3>
              </div>
            </div>
          </div>
          <p><span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> is the lowest level tool for the Debian package management.  This is very powerful and needs to be used with care.</p>
          <p>While installing package called "<code class="literal">&lt;package_name&gt;</code>", <code class="literal">dpkg</code> process it in the following order.</p>
          <div class="orderedlist">
            <ol class="orderedlist">
              <li class="listitem">
                <p>
Unpack the deb file ("<code class="literal">ar -x</code>" equivalent)
</p>
              </li>
              <li class="listitem">
                <p>
Execute "<code class="literal">&lt;package_name&gt;.preinst</code>" using <span class="citerefentry"><span class="refentrytitle">debconf</span>(1)</span>
</p>
              </li>
              <li class="listitem">
                <p>
Install the package content to the system ("<code class="literal">tar -x</code>" equivalent)
</p>
              </li>
              <li class="listitem">
                <p>
Execute "<code class="literal">&lt;package_name&gt;.postinst</code>" using <span class="citerefentry"><span class="refentrytitle">debconf</span>(1)</span>
</p>
              </li>
            </ol>
          </div>
          <p>The <code class="literal">debconf</code> system provides standardized user interaction with I18N and L10N (<a class="xref" href="ch08.en.html" title="Chapter 8. I18N and L10N">Chapter 8, <em>I18N and L10N</em></a>) supports.</p>
          <div class="table">
            <a id="thenotablefilescreatedbydpkg"/>
            <p class="title">
              <strong>Table 2.17. The notable files created by <code class="literal">dpkg</code></strong>
            </p>
            <div class="table-contents">
              <table summary="The notable files created by dpkg" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    file
    </th>
                    <th style="text-align: left">
    description of contents
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.conffiles</code>
                </td>
                    <td style="text-align: left">
    list of configuration files. (user modifiable)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.list</code>
                </td>
                    <td style="text-align: left">
    list of files and directories installed by the package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.md5sums</code>
                </td>
                    <td style="text-align: left">
    list of MD5 hash values for files installed by the package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.preinst</code>
                </td>
                    <td style="text-align: left">
    package script to be run before the package installation
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.postinst</code>
                </td>
                    <td style="text-align: left">
    package script to be run after the package installation
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.prerm</code>
                </td>
                    <td style="text-align: left">
    package script to be run before the package removal
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.postrm</code>
                </td>
                    <td style="text-align: left">
    package script to be run after the package removal
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.config</code>
                </td>
                    <td style="text-align: left">
    package script for <code class="literal">debconf</code> system
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/alternatives/&lt;package_name&gt;</code>
                </td>
                    <td style="text-align: left">
    the alternative information used by the <code class="literal">update-alternatives</code> command
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/available</code>
                </td>
                    <td style="text-align: left">
    the availability information for all the package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/diversions</code>
                </td>
                    <td style="text-align: left">
    the diversions information used by <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> and set by <span class="citerefentry"><span class="refentrytitle">dpkg-divert</span>(8)</span>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/statoverride</code>
                </td>
                    <td style="text-align: left">
    the stat override information used by <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> and set by <span class="citerefentry"><span class="refentrytitle">dpkg-statoverride</span>(8)</span>
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/status</code>
                </td>
                    <td style="text-align: left">
    the status information for all the packages
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/lib/dpkg/status-old</code>
                </td>
                    <td style="text-align: left">
    the first-generation backup of the "<code class="literal">var/lib/dpkg/status</code>" file
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                  <code class="literal">/var/backups/dpkg.status*</code>
                </td>
                    <td style="text-align: left">
    the second-generation backup and older ones of the "<code class="literal">var/lib/dpkg/status</code>" file
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>The "<code class="literal">status</code>" file is also used by the tools such as <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span>, "<code class="literal">dselect update</code>" and "<code class="literal">apt-get -u dselect-upgrade</code>".</p>
          <p>The specialized search command <span class="citerefentry"><span class="refentrytitle">grep-dctrl</span>(1)</span> can search the local copies of "<code class="literal">status</code>" and "<code class="literal">available</code>" meta data.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>In <a class="ulink" href="http://www.debian.org/devel/debian-installer/">the debian-installer</a> environment, the <code class="literal">udpkg</code> command is used to open <code class="literal">udeb</code> packages.  The <code class="literal">udpkg</code> command is a stripped down version of the <code class="literal">dpkg</code> command.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_update_alternatives_command"/>2.5.10. The update-alternatives command</h3>
              </div>
            </div>
          </div>
          <p>The Debian system has mechanism to install somewhat overlapping programs peacefully using <span class="citerefentry"><span class="refentrytitle">update-alternatives</span>(8)</span>.  For example, you can make the <code class="literal">vi</code> command select to run <code class="literal">vim</code> while installing both <code class="literal">vim</code> and <code class="literal">nvi</code> packages.</p>
          <pre class="screen">$ ls -l $(type -p vi)
lrwxrwxrwx 1 root root 20 2007-03-24 19:05 /usr/bin/vi -&gt; /etc/alternatives/vi
$ sudo update-alternatives --display vi
...
$ sudo update-alternatives --config vi
  Selection    Command
 ----------------------------------------------
      1        /usr/bin/vim
*+    2        /usr/bin/nvi

Enter to keep the default[*], or type selection number: 1</pre>
          <p>The Debian alternatives system keeps its selection as symlinks in "<code class="literal">/etc/alternatives/</code>".  The selection process uses corresponding file in "<code class="literal">/var/lib/dpkg/alternatives/</code>".</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_dpkg_statoverride_command"/>2.5.11. The dpkg-statoverride command</h3>
              </div>
            </div>
          </div>
          <p><span class="strong"><strong>Stat overrides</strong></span> provided by the <span class="citerefentry"><span class="refentrytitle">dpkg-statoverride</span>(8)</span> command are a way to tell <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> to use a different owner or mode for a <span class="strong"><strong>file</strong></span> when a package is installed. If "<code class="literal">--update</code>" is specified and file exists, it is immediately set to the new owner and mode.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The direct alteration of owner or mode for a <span class="strong"><strong>file</strong></span> owned by the package using <code class="literal">chmod</code> or <code class="literal">chown</code> commands by the system administrator is reset by the next upgrade of the package.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>I use the word <span class="strong"><strong>file</strong></span> here, but in reality this can be any filesystem object that <code class="literal">dpkg</code> handles, including directories, devices, etc.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_dpkg_divert_command"/>2.5.12. The dpkg-divert command</h3>
              </div>
            </div>
          </div>
          <p>File <span class="strong"><strong>diversions</strong></span> provided by the <span class="citerefentry"><span class="refentrytitle">dpkg-divert</span>(8)</span> command are a way of forcing <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> not to install a file into its default location, but to a <span class="strong"><strong>diverted</strong></span> location.  The use of <code class="literal">dpkg-divert</code> is meant for the package maintenance scripts.  Its casual use by the system administrator is deprecated.</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_recovery_from_a_broken_system"/>2.6. Recovery from a broken system</h2>
            </div>
          </div>
        </div>
        <p>When running <code class="literal">unstable</code> system, the administrator is expected to recover from broken package management situation.</p>
        <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Caution">
            <tr>
              <td rowspan="2" align="center" valign="top">
                <img alt="[Caution]" src="images/caution.png"/>
              </td>
              <th align="left">Caution</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>Some methods described here are high risk actions.  You have been warned!</p>
              </td>
            </tr>
          </table>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_incompatibility_with_old_user_configuration"/>2.6.1. Incompatibility with old user configuration</h3>
              </div>
            </div>
          </div>
          <p>If a desktop GUI program experienced instability after significant upstream version upgrade, you should suspect interferences with old local configuration files created by it. If it is stable under a newly created user account, this hypothesis is confirmed.  (This is a bug of packaging and usually avoided by the packager.)</p>
          <p>To recover stability, you should move corresponding local configuration files and restart the GUI program.  You may need to read old configuration file contents to recover configuration information later.  (Do not erase them too quickly.)</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_different_packages_with_overlapped_files"/>2.6.2. Different packages with overlapped files</h3>
              </div>
            </div>
          </div>
          <p>Archive level package management systems, such as <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> or <span class="citerefentry"><span class="refentrytitle">apt-get</span>(1)</span>, do not even try to install packages with overlapped files using package dependencies (see <a class="xref" href="ch02.en.html#_package_dependencies" title="2.1.6. Package dependencies">Section 2.1.6, “Package dependencies”</a>).</p>
          <p>Errors by the package maintainer or deployment of inconsistently mixed source of archives (see <a class="xref" href="ch02.en.html#_packages_from_mixed_source_of_archives" title="2.7.2. Packages from mixed source of archives">Section 2.7.2, “Packages from mixed source of archives”</a>) by the system administrator may create a situation with incorrectly defined package dependencies. When you install a package with overlapped files using <span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span> or <span class="citerefentry"><span class="refentrytitle">apt-get</span>(1)</span> under such a situation, <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> which unpacks package ensures to return error to the calling program without overwriting existing files.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The use of third party packages introduces significant system risks via maintainer scripts which are run with root privilege and can do anything to your system.  The <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> command only protects against overwriting by the unpacking.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>You can work around such broken installation by removing the old offending package, <code class="literal">&lt;old-package&gt;</code>, first.</p>
          <pre class="screen">$ sudo dpkg -P &lt;old-package&gt;</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_fixing_broken_package_script"/>2.6.3. Fixing broken package script</h3>
              </div>
            </div>
          </div>
          <p>When a command in the package script returns error for some reason and the script exits with error, the package management system aborts their action and ends up with partially installed packages.  When a package contains bugs in its removal scripts, the package may become impossible to remove and quite nasty.</p>
          <p>For the package script problem of "<code class="literal">&lt;package_name&gt;</code>", you should look into following package scripts.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.preinst</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.postinst</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.prerm</code>"
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">/var/lib/dpkg/info/&lt;package_name&gt;.postrm</code>"
</p>
              </li>
            </ul>
          </div>
          <p>Edit the offending package script from the root using following techniques.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
disable the offending line by preceding "<code class="literal">#</code>"
</p>
              </li>
              <li class="listitem">
                <p>
force to return success by appending the offending line with "<code class="literal">|| true</code>"
</p>
              </li>
            </ul>
          </div>
          <p>Configure all partially installed packages with the following command.</p>
          <pre class="screen"># dpkg --configure -a</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_rescue_with_the_dpkg_command"/>2.6.4. Rescue with the dpkg command</h3>
              </div>
            </div>
          </div>
          <p>Since <code class="literal">dpkg</code> is very low level package tool, it can function under the very bad situation such as unbootable system without network connection.  Let's assume <code class="literal">foo</code> package was broken and needs to be replaced.</p>
          <p>You may still find cached copies of older bug free version of <code class="literal">foo</code> package in the package cache directory: "<code class="literal">/var/cache/apt/archives/</code>".  (If not, you can download it from archive of <a class="ulink" href="http://snapshot.debian.net/">http://snapshot.debian.net/</a> or copy it from package cache of a functioning machine.)</p>
          <p>If you can boot the system, you may install it by the following command.</p>
          <pre class="screen"># dpkg -i /path/to/foo_&lt;old_version&gt;_&lt;arch&gt;.deb</pre>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If system breakage is minor, you may alternatively downgrade the whole system as in <a class="xref" href="ch02.en.html#_emergency_downgrading" title="2.7.10. Emergency downgrading">Section 2.7.10, “Emergency downgrading”</a> using the higher level APT system.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>If your system is unbootable from hard disk, you should seek other ways to boot it.</p>
          <div class="orderedlist">
            <ol class="orderedlist">
              <li class="listitem">
                <p>
Boot the system using the debian-installer CD in rescue mode.
</p>
              </li>
              <li class="listitem">
                <p>
Mount the unbootable system on the hard disk to "<code class="literal">/target</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Install older version of <code class="literal">foo</code> package by the following.
</p>
              </li>
            </ol>
          </div>
          <pre class="screen"># dpkg --root /target -i /path/to/foo_&lt;old_version&gt;_&lt;arch&gt;.deb</pre>
          <p>This example works even if the <code class="literal">dpkg</code> command on the hard disk is broken.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Any GNU/Linux system started by another system on hard disk, live GNU/Linux CD, bootable USB-key drive, or netboot can be used similarly to rescue broken system.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>If attempting to install a package this way fails due to some dependency violations and you really need to do this as the last resort, you can override dependency using <code class="literal">dpkg</code>'s "<code class="literal">--ignore-depends</code>", "<code class="literal">--force-depends</code>" and other options.    If you do this, you need to make serious effort to restore proper dependency later. See <span class="citerefentry"><span class="refentrytitle">dpkg</span>(8)</span> for details.</p>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If your system is seriously broken, you should make a full backup of system to a safe place (see <a class="xref" href="ch10.en.html#_backup_and_recovery" title="10.2. Backup and recovery">Section 10.2, “Backup and recovery”</a>) and should perform a clean installation.  This is less time consuming and produces better results in the end.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_recovering_package_selection_data"/>2.6.5. Recovering package selection data</h3>
              </div>
            </div>
          </div>
          <p>If "<code class="literal">/var/lib/dpkg/status</code>" becomes corrupt for any reason, the Debian system loses package selection data and suffers severely.  Look for the old "<code class="literal">/var/lib/dpkg/status</code>" file at "<code class="literal">/var/lib/dpkg/status-old</code>" or "<code class="literal">/var/backups/dpkg.status.*</code>".</p>
          <p>Keeping "<code class="literal">/var/backups/</code>" in a separate partition may be a good idea since this directory contains lots of important system data.</p>
          <p>For serious breakage, I recommend to make fresh re-install after making backup of the system. Even if everything in "<code class="literal">/var/</code>" is gone, you can still recover some information from directories in "<code class="literal">/usr/share/doc/</code>" to guide your new installation.</p>
          <p>Reinstall minimal (desktop) system.</p>
          <pre class="screen"># mkdir -p /path/to/old/system</pre>
          <p>Mount old system at "<code class="literal">/path/to/old/system/</code>".</p>
          <pre class="screen"># cd /path/to/old/system/usr/share/doc
# ls -1 &gt;~/ls1.txt
# cd /usr/share/doc
# ls -1 &gt;&gt;~/ls1.txt
# cd
# sort ls1.txt | uniq | less</pre>
          <p>Then you are presented with package names to install.  (There may be some non-package names such as "<code class="literal">texmf</code>".)</p>
        </div>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="_tips_for_the_package_management"/>2.7. Tips for the package management</h2>
            </div>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_how_to_pick_debian_packages"/>2.7.1. How to pick Debian packages</h3>
              </div>
            </div>
          </div>
          <p>You can seek packages which satisfy your needs with <code class="literal">aptitude</code> from the package description or from the list under "Tasks".</p>
          <p>When you encounter more than 2 similar packages and wonder which one to install without "trial and error" efforts, you should use some <span class="strong"><strong>common sense</strong></span>.  I consider following points are good indications of preferred packages.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Essential: yes &gt; no
</p>
              </li>
              <li class="listitem">
                <p>
Area: main &gt; contrib &gt; non-free
</p>
              </li>
              <li class="listitem">
                <p>
Priority: required &gt; important &gt; standard &gt; optional &gt; extra
</p>
              </li>
              <li class="listitem">
                <p>
Tasks: packages listed in tasks such as "Desktop environment"
</p>
              </li>
              <li class="listitem">
                <p>
Packages selected by the dependency package (e.g., <code class="literal">python2.4</code> by <code class="literal">python</code>)
</p>
              </li>
              <li class="listitem">
                <p>
Popcon: higher in the vote and install number
</p>
              </li>
              <li class="listitem">
                <p>
Changelog: regular updates by the maintainer
</p>
              </li>
              <li class="listitem">
                <p>
BTS: No RC bugs (no critical, no grave, and no serious bugs)
</p>
              </li>
              <li class="listitem">
                <p>
BTS: responsive maintainer to bug reports
</p>
              </li>
              <li class="listitem">
                <p>
BTS: higher number of the recently fixed bugs
</p>
              </li>
              <li class="listitem">
                <p>
BTS: lower number of remaining non-wishlist bugs
</p>
              </li>
            </ul>
          </div>
          <p>Debian being a volunteer project with distributed development model, its archive contains many packages with different focus and quality.  You must make your own decision what to do with them.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_packages_from_mixed_source_of_archives"/>2.7.2. Packages from mixed source of archives</h3>
              </div>
            </div>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Installing packages from mixed source of archives is not supported by the official Debian distribution except for officially supported particular combinations of archives such as <code class="literal">stable</code> with <a class="ulink" href="http://www.debian.org/security/">security updates</a> and <a class="ulink" href="http://www.debian.org/News/2011/20110215">jessie-updates</a>.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Here is an example of operations to include specific newer upstream version packages found in <code class="literal">unstable</code> while tracking <code class="literal">testing</code> for single occasion.</p>
          <div class="orderedlist">
            <ol class="orderedlist">
              <li class="listitem">
                <p>
Change the "<code class="literal">/etc/apt/sources.list</code>" file temporarily to single "<code class="literal">unstable</code>" entry.
</p>
              </li>
              <li class="listitem">
                <p>
Run "<code class="literal">aptitude update</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Run "<code class="literal">aptitude install &lt;package-name&gt;</code>".
</p>
              </li>
              <li class="listitem">
                <p>
Recover the original "<code class="literal">/etc/apt/sources.list</code>" file for <code class="literal">testing</code>.
</p>
              </li>
              <li class="listitem">
                <p>
Run "<code class="literal">aptitude update</code>".
</p>
              </li>
            </ol>
          </div>
          <p>You do not create the "<code class="literal">/etc/apt/preferences</code>" file nor need to worry about apt-pinning with this manual approach.  But this is very cumbersome.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When using mixed source of archives, you must ensure compatibility of packages by yourself since the Debian does not guarantee it. If package incompatibility exists, you may break system. You must be able to judge these technical requirements. The use of mixed source of random archives is completely optional operation and its use is not something I encourage you to use.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>General rules for installing packages from different archives are the following.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Non-binary packages ("<code class="literal">Architecture: all</code>") are <span class="strong"><strong>safer</strong></span> to install.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
documentation packages: no special requirements
</p>
                    </li>
                    <li class="listitem">
                      <p>
interpreter program packages: compatible interpreter must be available
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
Binary packages (non "<code class="literal">Architecture: all</code>") usually face many road blocks and are <span class="strong"><strong>unsafe</strong></span> to install.
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p>
library version compatibility (including "<code class="literal">libc</code>")
</p>
                    </li>
                    <li class="listitem">
                      <p>
related utility program version compatibility
</p>
                    </li>
                    <li class="listitem">
                      <p>
Kernel <a class="ulink" href="http://en.wikipedia.org/wiki/Application_binary_interface">ABI</a> compatibility
</p>
                    </li>
                    <li class="listitem">
                      <p>
C++ <a class="ulink" href="http://en.wikipedia.org/wiki/Application_binary_interface">ABI</a> compatibility
</p>
                    </li>
                    <li class="listitem">
                      <p></p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>In order to make a package to be <span class="strong"><strong>safer</strong></span> to install, some commercial non-free binary program packages may be provided with completely statically linked libraries.  You should still check <a class="ulink" href="http://en.wikipedia.org/wiki/Application_binary_interface">ABI</a> compatibility issues etc. for them.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Except to avoid broken package for a short term, installing binary packages from officially unsupported archives is generally bad idea.  This is true even if you use apt-pinning (see <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a>).  You should consider chroot or similar techniques (see <a class="xref" href="ch09.en.html#_virtualized_system" title="9.10. Virtualized system">Section 9.10, “Virtualized system”</a>) to run programs from different archives.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_tweaking_candidate_version"/>2.7.3. Tweaking candidate version</h3>
              </div>
            </div>
          </div>
          <p>Without the "<code class="literal">/etc/apt/preferences</code>" file, APT system choses the latest available version as the <span class="strong"><strong>candidate version</strong></span> using the version string.  This is the normal state and most recommended usage of APT system.  All officially supported combinations of archives do not require the "<code class="literal">/etc/apt/preferences</code>" file since some archives which should not be used as the automatic source of upgrades are marked as <span class="strong"><strong>NotAutomatic</strong></span> and dealt properly.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The version string comparison rule can be verified with, e.g., "<code class="literal">dpkg  --compare-versions ver1.1 gt ver1.1~1; echo $?</code>" (see <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span>).</p>
                </td>
              </tr>
            </table>
          </div>
          <p>When you install packages from mixed source of archives (see <a class="xref" href="ch02.en.html#_packages_from_mixed_source_of_archives" title="2.7.2. Packages from mixed source of archives">Section 2.7.2, “Packages from mixed source of archives”</a>) regularly, you can automate these complicated operations by creating the "<code class="literal">/etc/apt/preferences</code>" file with proper entries and tweaking the package selection rule for <span class="strong"><strong>candidate version</strong></span> as described in <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span>.  This is called <span class="strong"><strong>apt-pinning</strong></span>.</p>
          <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Warning">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Warning]" src="images/warning.png"/>
                </td>
                <th align="left">Warning</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Use of apt-pinning by a novice user is sure call for major troubles.  You must avoid using apt-pinning except when you absolutely need it.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When using apt-pinning, you must ensure compatibility of packages by yourself since the Debian does not guarantee it.  The apt-pinning is completely optional operation and its use is not something I encourage you to use.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Archive level Release files (see <a class="xref" href="ch02.en.html#_archive_level_release_files" title="2.5.3. Archive level &quot;Release&quot; files">Section 2.5.3, “Archive level "Release" files”</a>) are used for the rule of <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span>.  Thus apt-pinning works only with "suite" name for <a class="ulink" href="http://ftp.us.debian.org/debian/dists/">normal Debian archives</a> and <a class="ulink" href="http://security.debian.org/dists/">security Debian archives</a>. (This is different from <a class="ulink" href="http://www.ubuntu.com/">Ubuntu</a> archives.)  For example, you can do "<code class="literal">Pin: release a=unstable</code>" but can not do "<code class="literal">Pin: release a=sid</code>" in the "<code class="literal">/etc/apt/preferences</code>" file.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When you use non-Debian archive as a part of apt-pinning, you should check what they are intended for and also check their credibility.  For example, Ubuntu and Debian are not meant to be mixed.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Note">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Note]" src="images/note.png"/>
                </td>
                <th align="left">Note</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Even if you do not create the "<code class="literal">/etc/apt/preferences</code>" file, you can do fairly complex system operations (see <a class="xref" href="ch02.en.html#_rescue_with_the_dpkg_command" title="2.6.4. Rescue with the dpkg command">Section 2.6.4, “Rescue with the dpkg command”</a> and <a class="xref" href="ch02.en.html#_packages_from_mixed_source_of_archives" title="2.7.2. Packages from mixed source of archives">Section 2.7.2, “Packages from mixed source of archives”</a>) without apt-pinning.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Here is a simplified explanation of <span class="strong"><strong>apt-pinning</strong></span> technique.</p>
          <p>The APT system choses the highest Pin-Priority <span class="strong"><strong>upgrading</strong></span> package from available package sources defined in the "<code class="literal">/etc/apt/sources.list</code>" file as the <span class="strong"><strong>candidate version</strong></span> package.  If the Pin-Priority of the package is larger than 1000, this version restriction for <span class="strong"><strong>upgrading</strong></span> is dropped to enable downgrading (see <a class="xref" href="ch02.en.html#_emergency_downgrading" title="2.7.10. Emergency downgrading">Section 2.7.10, “Emergency downgrading”</a>).</p>
          <p>Pin-Priority value of each package is defined by "Pin-Priority" entries in the "<code class="literal">/etc/apt/preferences</code>" file or uses its default value.</p>
          <div class="table">
            <a id="listofnotablepinpinningtechnique"/>
            <p class="title">
              <strong>Table 2.18. List of notable Pin-Priority values for <span class="strong">apt-pinning</span> technique.</strong>
            </p>
            <div class="table-contents">
              <table summary="List of notable Pin-Priority values for apt-pinning technique." border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    Pin-Priority
    </th>
                    <th style="text-align: left">
    apt-pinning effects to the package
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
    1001
    </td>
                    <td style="text-align: left">
    install the package even if this constitutes a downgrade of the package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    990
    </td>
                    <td style="text-align: left">
    used as the default for the <span class="strong"><strong>target release</strong></span> archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    500
    </td>
                    <td style="text-align: left">
    used as the default for the <span class="strong"><strong>normal</strong></span> archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    100
    </td>
                    <td style="text-align: left">
    used as the default for the <span class="strong"><strong>NotAutomatic</strong></span> and <span class="strong"><strong>ButAutomaticUpgrades</strong></span> archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    100
    </td>
                    <td style="text-align: left">
    used for the <span class="strong"><strong>installed</strong></span> package
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    1
    </td>
                    <td style="text-align: left">
    used as the default for the <span class="strong"><strong>NotAutomatic</strong></span> archive
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
    -1
    </td>
                    <td style="text-align: left"><span class="strong"><strong>never install</strong></span> the package even if recommended
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <p>The <span class="strong"><strong>target release</strong></span> archive can be set by several methods.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
"<code class="literal">/etc/apt/apt.conf</code>" configuration file with "<code class="literal">APT::Default-Release "stable";</code>" line
</p>
              </li>
              <li class="listitem">
                <p>
command line option, e.g., "<code class="literal">apt-get install -t testing some-package</code>"
</p>
              </li>
            </ul>
          </div>
          <p>The  <span class="strong"><strong>NotAutomatic</strong></span> and <span class="strong"><strong>ButAutomaticUpgrades</strong></span> archive is set by archive server having its archive level Release file (see <a class="xref" href="ch02.en.html#_archive_level_release_files" title="2.5.3. Archive level &quot;Release&quot; files">Section 2.5.3, “Archive level "Release" files”</a>) containing both "<code class="literal">NotAutomatic: yes</code>" and "<code class="literal">ButAutomaticUpgrades: yes</code>". The  <span class="strong"><strong>NotAutomatic</strong></span> archive is set by archive server having its archive level Release file containing only "<code class="literal">NotAutomatic: yes</code>".</p>
          <p>The <span class="strong"><strong>apt-pinning situation</strong></span> of &lt;package&gt; from multiple archive sources is displayed by "<code class="literal">apt-cache policy &lt;package&gt;</code>".</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
A line started with "<code class="literal">Package pin:</code>" lists the package version of <span class="strong"><strong>pin</strong></span> if association just with &lt;package&gt; is defined, e.g., "<code class="literal">Package pin: 0.190</code>".
</p>
              </li>
              <li class="listitem">
                <p>
No line with "<code class="literal">Package pin:</code>" exists if no association just with &lt;package&gt; is defined.
</p>
              </li>
              <li class="listitem">
                <p>
The Pin-Priority value associated just with &lt;package&gt; is listed right side of all version strings, e.g., "<code class="literal">0.181 700</code>".
</p>
              </li>
              <li class="listitem">
                <p>
"<code class="literal">0</code>" is listed right side of all version strings if no association just with &lt;package&gt; is defined, e.g., "<code class="literal">0.181 0</code>".
</p>
              </li>
              <li class="listitem">
                <p>
The Pin-Priority values of archives (defined as "<code class="literal">Package: *</code>" in the "<code class="literal">/etc/apt/preferences</code>" file) are listed left side of all archive paths, e.g., "<code class="literal">100 http://ftp.XX.debian.org/debian/ jessie-backports/main Packages</code>".
</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_updates_and_backports"/>2.7.4. Updates and Backports</h3>
              </div>
            </div>
          </div>
          <p>There are <a class="ulink" href="http://www.debian.org/News/2011/20110215">jessie-updates</a> and <a class="ulink" href="http://backports.debian.org">backports.debian.org</a> archives which provide updgrade packages for <code class="literal">stable</code> (<code class="literal">jessie</code>).</p>
          <p>In order to use these archives, you list all required archives in the "<code class="literal">/etc/apt/sources.list</code>" file as the following.</p>
          <pre class="screen">deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib
deb http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-backports main contrib non-free</pre>
          <p>There is no need to set Pin-Priority value explicitly in the "<code class="literal">/etc/apt/preferences</code>" file.  When newer packages become available, the default configuration provides most reasonable upgrades (see <a class="xref" href="ch02.en.html#_archive_level_release_files" title="2.5.3. Archive level &quot;Release&quot; files">Section 2.5.3, “Archive level "Release" files”</a>).</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
All installed older packages are upgraded to newer ones from <code class="literal">jessie-updates</code>.
</p>
              </li>
              <li class="listitem">
                <p>
Only manually installed older packages from <code class="literal">jessie-backports</code> are upgraded to newer ones from <code class="literal">jessie-backports</code>.
</p>
              </li>
            </ul>
          </div>
          <p>Whenever you wish to install a package named "<code class="literal">&lt;package-name&gt;</code>" with its dependency from <code class="literal">jessie-backports</code> archive manually, you use following command while switching target release with "<code class="literal">-t</code>" option.</p>
          <pre class="screen">$ sudo apt-get install -t jessie-backports &lt;package-name&gt;</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_blocking_packages_installed_by_recommends"/>2.7.5. Blocking packages installed by "Recommends"</h3>
              </div>
            </div>
          </div>
          <p>If you wish not to pull in particular packages automatically by "Recommends", you must create the "<code class="literal">/etc/apt/preferences</code>" file and explicitly list all those packages at the top of it as the following.</p>
          <pre class="screen">Package: &lt;package-1&gt;
Pin: version *
Pin-Priority: -1

Package: &lt;package-2&gt;
Pin: version *
Pin-Priority: -1</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_tracking_literal_testing_literal_with_some_packages_from_literal_unstable_literal"/>2.7.6. Tracking <code class="literal">testing</code> with some packages from <code class="literal">unstable</code></h3>
              </div>
            </div>
          </div>
          <p>Here is an example of <span class="strong"><strong>apt-pinning</strong></span> technique to include specific newer upstream version packages found in <code class="literal">unstable</code> regularly upgraded while tracking <code class="literal">testing</code>.  You list all required archives in the "<code class="literal">/etc/apt/sources.list</code>" file as the following.</p>
          <pre class="screen">deb http://ftp.us.debian.org/debian/ testing main contrib non-free
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb http://security.debian.org/ testing/updates main contrib</pre>
          <p>Set the "<code class="literal">/etc/apt/preferences</code>" file as as the following.</p>
          <pre class="screen">Package: *
Pin: release a=unstable
Pin-Priority: 100</pre>
          <p>When you wish to install a package named "<code class="literal">&lt;package-name&gt;</code>" with its dependencies from <code class="literal">unstable</code> archive under this configuration, you issue the following command which switches target release with "<code class="literal">-t</code>" option (Pin-Priority of <code class="literal">unstable</code> becomes 990).</p>
          <pre class="screen">$ sudo apt-get install -t unstable &lt;package-name&gt;</pre>
          <p>With this configuration, usual execution of "<code class="literal">apt-get upgrade</code>" and "<code class="literal">apt-get dist-upgrade</code>" (or "<code class="literal">aptitude safe-upgrade</code>" and "<code class="literal">aptitude full-upgrade</code>") upgrades packages which were installed from <code class="literal">testing</code> archive using current <code class="literal">testing</code> archive and packages which were installed from <code class="literal">unstable</code> archive using current <code class="literal">unstable</code> archive.</p>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Be careful not to remove "<code class="literal">testing</code>" entry from the "<code class="literal">/etc/apt/sources.list</code>" file.  Without "<code class="literal">testing</code>" entry in it, APT system upgrades packages using newer <code class="literal">unstable</code> archive.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>I usually edit the "<code class="literal">/etc/apt/sources.list</code>" file to comment out "<code class="literal">unstable</code>" archive entry right after above operation.  This avoids slow update process of having too many entries in the "<code class="literal">/etc/apt/sources.list</code>" file although this prevents upgrading packages which were installed from <code class="literal">unstable</code> archive using current <code class="literal">unstable</code> archive.</p>
                </td>
              </tr>
            </table>
          </div>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If "<code class="literal">Pin-Priority: 1</code>" is used instead of "<code class="literal">Pin-Priority: 100</code>" in the "<code class="literal">/etc/apt/preferences</code>" file, already installed packages having Pin-Priority value of 100 are not upgraded by <code class="literal">unstable</code> archive even if "<code class="literal">testing</code>" entry in the "<code class="literal">/etc/apt/sources.list</code>" file is removed.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>If you wish to track particular packages in <code class="literal">unstable</code> automatically without initial "<code class="literal">-t unstable</code>" installation, you must create the "<code class="literal">/etc/apt/preferences</code>" file and explicitly list all those packages at the top of it as the following.</p>
          <pre class="screen">Package: &lt;package-1&gt;
Pin: release a=unstable
Pin-Priority: 700

Package: &lt;package-2&gt;
Pin: release a=unstable
Pin-Priority: 700</pre>
          <p>These set Pin-Priority value for each specific package.  For example, in order to track the latest <code class="literal">unstable</code> version of this "Debian Reference" in English, you should have following entries in the "<code class="literal">/etc/apt/preferences</code>" file.</p>
          <pre class="screen">Package: debian-reference-en
Pin: release a=unstable
Pin-Priority: 700

Package: debian-reference-common
Pin: release a=unstable
Pin-Priority: 700</pre>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>This apt-pinning technique is valid even when you are tracking <code class="literal">stable</code> archive.  Documentation packages have been always safe to install from <code class="literal">unstable</code> archive in my experience, so far.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_tracking_literal_unstable_literal_with_some_packages_from_literal_experimental_literal"/>2.7.7. Tracking <code class="literal">unstable</code> with some packages from <code class="literal">experimental</code></h3>
              </div>
            </div>
          </div>
          <p>Here is another example of <span class="strong"><strong>apt-pinning</strong></span> technique to include specific newer upstream version packages found in <code class="literal">experimental</code> while tracking <code class="literal">unstable</code>.  You list all required archives in the "<code class="literal">/etc/apt/sources.list</code>" file as the following.</p>
          <pre class="screen">deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free
deb http://security.debian.org/ testing/updates main contrib</pre>
          <p>The default Pin-Priority value for <code class="literal">experimental</code> archive is always 1 (&lt;&lt;100) since it is <span class="strong"><strong>NotAutomatic</strong></span> archive (see <a class="xref" href="ch02.en.html#_archive_level_release_files" title="2.5.3. Archive level &quot;Release&quot; files">Section 2.5.3, “Archive level "Release" files”</a>).  There is no need to set Pin-Priority value explicitly in the "<code class="literal">/etc/apt/preferences</code>" file just to use <code class="literal">experimental</code> archive unless you wish to track particular packages in it automatically for next upgrading.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_automatic_download_and_upgrade_of_packages"/>2.7.8. Automatic download and upgrade of packages</h3>
              </div>
            </div>
          </div>
          <p>The <code class="literal">apt</code> package comes with its own cron script "<code class="literal">/etc/cron.daily/apt</code>" to support the automatic download of packages.  This script can be enhanced to perform the automatic upgrade of packages by installing the <code class="literal">unattended-upgrades</code> package. These can be customized by parameters in "<code class="literal">/etc/apt/apt.conf.d/02backup</code>" and "<code class="literal">/etc/apt/apt.conf.d/50unattended-upgrades</code>" as described in "<code class="literal">/usr/share/doc/unattended-upgrades/README</code>".</p>
          <p>The <code class="literal">unattended-upgrades</code> package is mainly intended for the security upgrade for the <code class="literal">stable</code> system.  If the risk of breaking an existing <code class="literal">stable</code> system by the automatic upgrade is smaller than that of the system broken by the intruder using its security hole which has been closed by the security update, you should consider using this automatic upgrade with configuration parameters as the following.</p>
          <pre class="screen">APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "1";</pre>
          <p>If you are running an <code class="literal">unstable</code> system, you do not want to use the automatic upgrade since it certainly breaks system some day.  Even for such <code class="literal">unstable</code> case, you may still want to download packages in advance to save time for the interactive upgrade with configuration parameters as the following.</p>
          <pre class="screen">APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "0";</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_limiting_download_bandwidth_for_apt"/>2.7.9. Limiting download bandwidth for APT</h3>
              </div>
            </div>
          </div>
          <p>If you want to limit the download bandwidth for APT to e.g. 800Kib/sec (=100kiB/sec), you should configure APT with its configuration parameter as the following.</p>
          <pre class="screen">APT::Acquire::http::Dl-Limit "800";</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_emergency_downgrading"/>2.7.10. Emergency downgrading</h3>
              </div>
            </div>
          </div>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Downgrading is not officially supported by the Debian by design.  It should be done only as a part of emergency recovery process.  Despite of this situation, it is known to work well in many incidents.  For critical systems, you should backup all important data on the system after the recovery operation and re-install the new system from the scratch.</p>
                </td>
              </tr>
            </table>
          </div>
          <p>You may be lucky to downgrade from newer archive to older archive to recover from broken system upgrade by manipulating <span class="strong"><strong>candidate version</strong></span> (see <a class="xref" href="ch02.en.html#_tweaking_candidate_version" title="2.7.3. Tweaking candidate version">Section 2.7.3, “Tweaking candidate version”</a>).  This is lazy alternative to tedious actions of many "<code class="literal">dpkg -i &lt;broken-package&gt;_&lt;old-version&gt;.deb</code>" commands (see <a class="xref" href="ch02.en.html#_rescue_with_the_dpkg_command" title="2.6.4. Rescue with the dpkg command">Section 2.6.4, “Rescue with the dpkg command”</a>).</p>
          <p>Search lines in the "<code class="literal">/etc/apt/sources.list</code>" file tracking <code class="literal">unstable</code> as the following.</p>
          <pre class="screen">deb http://ftp.us.debian.org/debian/ sid main contrib non-free</pre>
          <p>Replace it with the following to track <code class="literal">testing</code>.</p>
          <pre class="screen">deb http://ftp.us.debian.org/debian/ stretch main contrib non-free</pre>
          <p>Set the "<code class="literal">/etc/apt/preferences</code>" file as the following.</p>
          <pre class="screen">Package: *
Pin: release a=testing
Pin-Priority: 1010</pre>
          <p>Run "<code class="literal">apt-get update; apt-get dist-upgrade</code>" to force downgrading of packages across the system.</p>
          <p>Remove this special "<code class="literal">/etc/apt/preferences</code>" file after this emergency downgrading.</p>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>It is a good idea to remove (not purge!) as much packages to minimize dependency problems.  You may need to manually remove and install some packages to get system downgraded.  Linux kernel, bootloader, udev, PAM, APT, and networking related packages and their configuration files require special attention.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_who_uploaded_the_package"/>2.7.11. Who uploaded the package?</h3>
              </div>
            </div>
          </div>
          <p>Although the maintainer name listed in "<code class="literal">/var/lib/dpkg/available</code>" and "<code class="literal">/usr/share/doc/package_name/changelog</code>" provide some information on "who is behind the packaging activity", the actual uploader of the package is somewhat obscure.  <span class="citerefentry"><span class="refentrytitle">who-uploads</span>(1)</span> in the <code class="literal">devscripts</code> package identifies the actual uploader of Debian source packages.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_the_equivs_package"/>2.7.12. The equivs package</h3>
              </div>
            </div>
          </div>
          <p>If you are to compile a program from source to replace the Debian package, it is best to make it into a real local debianized package (<code class="literal">*.deb</code>) and use private archive.</p>
          <p>If you chose to compile a program from source and to install them under "<code class="literal">/usr/local</code>" instead, you may need to use <code class="literal">equivs</code> as a last resort to satisfy the missing package dependency.</p>
          <pre class="screen">Package: equivs
Priority: extra
Section: admin
Description: Circumventing Debian package dependencies
 This is a dummy package which can be used to create Debian
 packages, which only contain dependency information.</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_porting_a_package_to_the_stable_system"/>2.7.13. Porting a package to the stable system</h3>
              </div>
            </div>
          </div>
          <p>For partial upgrades of the <code class="literal">stable</code> system, rebuilding a package within its environment using the source package is desirable.  This avoids massive package upgrades due to their dependencies.</p>
          <p>Add the following entries to the "<code class="literal">/etc/apt/sources.list</code>" of a <code class="literal">stable</code> system.</p>
          <pre class="screen">deb-src http://http.us.debian.org/debian unstable  main contrib non-free</pre>
          <p>Install required packages for the compilation and download the source package as the following.</p>
          <pre class="screen"># apt-get update
# apt-get dist-upgrade
# apt-get install fakeroot devscripts build-essential
$ apt-get build-dep foo
$ apt-get source foo
$ cd foo*</pre>
          <p>Update some tool chain packages such as <code class="literal">dpkg</code>, and <code class="literal">debhelper</code> from the
backport packages if they are required for the backporting.</p>
          <p>Execute the following.</p>
          <pre class="screen">$ dch -i</pre>
          <p>Bump package version, e.g. one appended with "<code class="literal">+bp1</code>" in "<code class="literal">debian/changelog</code>"</p>
          <p>Build packages and install them to the system as the following.</p>
          <pre class="screen">$ debuild
$ cd ..
# debi foo*.changes</pre>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_proxy_server_for_apt"/>2.7.14. Proxy server for APT</h3>
              </div>
            </div>
          </div>
          <p>Since mirroring whole subsection of Debian archive wastes disk space and network bandwidth, deployment of a local proxy server for APT is desirable consideration when you administer many systems on <a class="ulink" href="http://en.wikipedia.org/wiki/Local_area_network">LAN</a>.  APT can be configure to use generic web (http) proxy servers such as <code class="literal">squid</code> (see <a class="xref" href="ch06.en.html#_other_network_application_servers" title="6.10. Other network application servers">Section 6.10, “Other network application servers”</a>) as described in <span class="citerefentry"><span class="refentrytitle">apt.conf</span>(5)</span> and in "<code class="literal">/usr/share/doc/apt/examples/configure-index.gz</code>".  The "<code class="literal">$http_proxy</code>" environment variable can be used to override proxy server setting in the "<code class="literal">/etc/apt/apt.conf</code>" file.</p>
          <p>There are proxy tools specially for Debian archive.  You should check BTS before using them.</p>
          <div class="table">
            <a id="listoftheproxytofordebianarchive"/>
            <p class="title">
              <strong>Table 2.19. List of the proxy tools specially for Debian archive</strong>
            </p>
            <div class="table-contents">
              <table summary="List of the proxy tools specially for Debian archive" border="1">
                <colgroup>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                  <col style="text-align: left"/>
                </colgroup>
                <thead>
                  <tr>
                    <th style="text-align: left">
    package
    </th>
                    <th style="text-align: left">
    popcon
    </th>
                    <th style="text-align: left">
    size
    </th>
                    <th style="text-align: left">
    description
    </th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.debian.org/sid/approx">
                  <code class="literal">approx</code>
                </a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://qa.debian.org/popcon.php?package=approx">V:1, I:1</a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.qa.debian.org/a/approx.html">4263</a>
                    </td>
                    <td style="text-align: left">
    caching proxy server for Debian archive files (compiled <a class="ulink" href="http://en.wikipedia.org/wiki/Objective_Caml">OCaml</a> program)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.debian.org/sid/apt-cacher">
                  <code class="literal">apt-cacher</code>
                </a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-cacher">V:1, I:2</a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.qa.debian.org/a/apt-cacher.html">326</a>
                    </td>
                    <td style="text-align: left">
    Caching proxy for Debian package and source files (Perl program)
    </td>
                  </tr>
                  <tr>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.debian.org/sid/apt-cacher-ng">
                  <code class="literal">apt-cacher-ng</code>
                </a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://qa.debian.org/popcon.php?package=apt-cacher-ng">V:3, I:5</a>
                    </td>
                    <td style="text-align: left">
                      <a class="ulink" href="http://packages.qa.debian.org/a/apt-cacher-ng.html">1022</a>
                    </td>
                    <td style="text-align: left">
    Caching proxy for distribution of software packages (compiled C++ program)
    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
          <br class="table-break"/>
          <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Caution">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Caution]" src="images/caution.png"/>
                </td>
                <th align="left">Caution</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>When Debian reorganizes its archive structure, these specialized proxy tools tend to require code rewrites by the package maintainer and may not be functional for a while.  On the other hand, generic web (http) proxy servers are more robust and easier to cope with such changes.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_small_public_package_archive"/>2.7.15. Small public package archive</h3>
              </div>
            </div>
          </div>
          <p>Here is an example for creating a small public package archive compatible with the modern <span class="strong"><strong>secure APT</strong></span> system (see <a class="xref" href="ch02.en.html#_top_level_release_file_and_authenticity" title="2.5.2. Top level &quot;Release&quot; file and authenticity">Section 2.5.2, “Top level "Release" file and authenticity”</a>). Let's assume few things.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Account name: "<code class="literal">foo</code>"
</p>
              </li>
              <li class="listitem">
                <p>
Host name: "<code class="literal">www.example.com</code>"
</p>
              </li>
              <li class="listitem">
                <p>
Required packages:  <code class="literal">apt-utils</code>, <code class="literal">gnupg</code>, and other packages
</p>
              </li>
              <li class="listitem">
                <p>
URL: "<code class="literal">http://www.example.com/~foo/</code>" ( → "<code class="literal">/home/foo/public_html/index.html</code>")
</p>
              </li>
              <li class="listitem">
                <p>
Architecture of packages: "<code class="literal">amd64</code>"
</p>
              </li>
            </ul>
          </div>
          <p>Create an APT archive key of Foo on your server system as the following.</p>
          <pre class="screen">$ ssh foo@www.example.com
$ gpg --gen-key
...
$ gpg -K
...
sec   1024D/3A3CB5A6 2008-08-14
uid                  Foo (ARCHIVE KEY) &lt;foo@www.example.com&gt;
ssb   2048g/6856F4A7 2008-08-14
$ gpg --export -a 3A3CB5A6 &gt;foo.public.key</pre>
          <p>Publish the archive key file "<code class="literal">foo.public.key</code>" with the key ID "<code class="literal">3A3CB5A6</code>" for Foo</p>
          <p>Create an archive tree called "Origin: Foo" as the following.</p>
          <pre class="screen">$ umask 022
$ mkdir -p ~/public_html/debian/pool/main
$ mkdir -p ~/public_html/debian/dists/unstable/main/binary-amd64
$ mkdir -p ~/public_html/debian/dists/unstable/main/source
$ cd ~/public_html/debian
$ cat &gt; dists/unstable/main/binary-amd64/Release &lt;&lt; EOF
Archive: unstable
Version: 4.0
Component: main
Origin: Foo
Label: Foo
Architecture: amd64
EOF
$ cat &gt; dists/unstable/main/source/Release &lt;&lt; EOF
Archive: unstable
Version: 4.0
Component: main
Origin: Foo
Label: Foo
Architecture: source
EOF
$ cat &gt;aptftp.conf &lt;&lt;EOF
APT::FTPArchive::Release {
  Origin "Foo";
  Label "Foo";
  Suite "unstable";
  Codename "sid";
  Architectures "amd64";
  Components "main";
  Description "Public archive for Foo";
};
EOF
$ cat &gt;aptgenerate.conf &lt;&lt;EOF
Dir::ArchiveDir ".";
Dir::CacheDir ".";
TreeDefault::Directory "pool/";
TreeDefault::SrcDirectory "pool/";
Default::Packages::Extensions ".deb";
Default::Packages::Compress ". gzip bzip2";
Default::Sources::Compress "gzip bzip2";
Default::Contents::Compress "gzip bzip2";

BinDirectory "dists/unstable/main/binary-amd64" {
  Packages "dists/unstable/main/binary-amd64/Packages";
  Contents "dists/unstable/Contents-amd64";
  SrcPackages "dists/unstable/main/source/Sources";
};

Tree "dists/unstable" {
  Sections "main";
  Architectures "amd64 source";
};
EOF</pre>
          <p>You can automate repetitive updates of APT archive contents on your server system by configuring <code class="literal">dupload</code>.</p>
          <p>Place all package files into "<code class="literal">~foo/public_html/debian/pool/main/</code>" by executing "<code class="literal">dupload -t foo changes_file</code>" in client while having "<code class="literal">~/.dupload.conf</code>" containing the following.</p>
          <pre class="screen">$cfg{'foo'} = {
  fqdn =&gt; "www.example.com",
  method =&gt; "scpb",
  incoming =&gt; "/home/foo/public_html/debian/pool/main",
  # The dinstall on ftp-master sends emails itself
  dinstall_runs =&gt; 1,
};

$cfg{'foo'}{postupload}{'changes'} = "
  echo 'cd public_html/debian ;
  apt-ftparchive generate -c=aptftp.conf aptgenerate.conf;
  apt-ftparchive release -c=aptftp.conf dists/unstable &gt;dists/unstable/Release ;
  rm -f dists/unstable/Release.gpg ;
  gpg -u 3A3CB5A6 -bao dists/unstable/Release.gpg dists/unstable/Release'|
  ssh foo@www.example.com  2&gt;/dev/null ;
  echo 'Package archive created!'";</pre>
          <p>The <span class="strong"><strong>postupload</strong></span> hook script initiated by <span class="citerefentry"><span class="refentrytitle">dupload</span>(1)</span> creates updated archive files for each upload.</p>
          <p>You can add this small public archive to the apt-line of your client system by the following.</p>
          <pre class="screen">$ sudo bash
# echo "deb http://www.example.com/~foo/debian/ unstable main" \
   &gt;&gt; /etc/apt/sources.list
# apt-key add foo.public.key</pre>
          <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Tip]" src="images/tip.png"/>
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>If the archive is located on the local filesystem, you can use "<code class="literal">deb file:///home/foo/debian/ …</code>" instead.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_recording_and_copying_system_configuration"/>2.7.16. Recording and copying system configuration</h3>
              </div>
            </div>
          </div>
          <p>You can make a local copy of the package and debconf selection states by the following.</p>
          <pre class="screen"># dpkg --get-selections '*' &gt; selection.dpkg
# debconf-get-selections    &gt; selection.debconf</pre>
          <p>Here, "<code class="literal">*</code>" makes "<code class="literal">selection.dpkg</code>" to include package entries for "purge" too.</p>
          <p>You can transfer these 2 files to another computer, and install there with the following.</p>
          <pre class="screen"># dselect update
# debconf-set-selections &lt; myselection.debconf
# dpkg --set-selections  &lt; myselection.dpkg
# apt-get -u dselect-upgrade    # or dselect install</pre>
          <p>If you are thinking about managing many servers in a cluster with practically the same configuration, you should consider to use specialized package such as <code class="literal">fai</code> to manage the whole system.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_converting_or_installing_an_alien_binary_package"/>2.7.17. Converting or installing an alien binary package</h3>
              </div>
            </div>
          </div>
          <p><span class="citerefentry"><span class="refentrytitle">alien</span>(1)</span> enables the conversion of binary packages provided in Red Hat <code class="literal">rpm</code>, Stampede <code class="literal">slp</code>, Slackware <code class="literal">tgz</code>, and Solaris <code class="literal">pkg</code> file formats into a Debian <code class="literal">deb</code> package.  If you want to use a package from another Linux distribution than the one you have installed on your system, you can use <code class="literal">alien</code> to convert it from your preferred package format and install it.  <code class="literal">alien</code> also supports LSB packages.</p>
          <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Warning">
              <tr>
                <td rowspan="2" align="center" valign="top">
                  <img alt="[Warning]" src="images/warning.png"/>
                </td>
                <th align="left">Warning</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p><span class="citerefentry"><span class="refentrytitle">alien</span>(1)</span> should not be used to replace essential system packages, such as <code class="literal">sysvinit</code>, <code class="literal">libc6</code>, <code class="literal">libpam-modules</code>, etc.  Practically, <span class="citerefentry"><span class="refentrytitle">alien</span>(1)</span> should only be used for <span class="strong"><strong>non-free</strong></span> binary-only packages which are LSB compliant or statically linked.  For free softwares, you should use their source packages to make real Debian packages.</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_extracting_package_without_dpkg"/>2.7.18. Extracting package without dpkg</h3>
              </div>
            </div>
          </div>
          <p>The "<code class="literal">dpkg*.deb</code>" package contents can be extracted without using <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span> on any <a class="ulink" href="http://en.wikipedia.org/wiki/Unix-like">Unix-like</a> environment using standard <span class="citerefentry"><span class="refentrytitle">ar</span>(1)</span> and <span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span>.</p>
          <pre class="screen"># ar x /path/to/dpkg_&lt;version&gt;_&lt;arch&gt;.deb
# ls
total 24
-rw-r--r-- 1 bozo bozo  1320 2007-05-07 00:11 control.tar.gz
-rw-r--r-- 1 bozo bozo 12837 2007-05-07 00:11 data.tar.gz
-rw-r--r-- 1 bozo bozo     4 2007-05-07 00:11 debian-binary
# mkdir control
# mkdir data
# tar xvzf control.tar.gz -C control
# tar xvzf data.tar.gz -C data</pre>
          <p>The other "<code class="literal">*.deb</code>" package contents can be extracted by the <span class="citerefentry"><span class="refentrytitle">dpkg-deb</span>(1)</span> command obtained from the "<code class="literal">dpkg*.deb</code>" package as above; or using standard <span class="citerefentry"><span class="refentrytitle">ar</span>(1)</span> and newer GNU <span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span> with the <span class="citerefentry"><span class="refentrytitle">xz</span>(1)</span> decompression support similarly as above.</p>
          <p>You can also browse package content using the <code class="literal">mc</code> command.</p>
        </div>
        <div class="section">
          <div class="titlepage">
            <div>
              <div>
                <h3 class="title"><a id="_more_readings_for_the_package_management"/>2.7.19. More readings for the package management</h3>
              </div>
            </div>
          </div>
          <p>You can learn more on the package management from following documentations.</p>
          <div class="itemizedlist">
            <ul class="itemizedlist">
              <li class="listitem">
                <p>
Primary documentations on the package management:
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p><span class="citerefentry"><span class="refentrytitle">aptitude</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">dpkg</span>(1)</span>, <span class="citerefentry"><span class="refentrytitle">tasksel</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">apt-get</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">apt-config</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">apt-key</span>(8)</span>, <span class="citerefentry"><span class="refentrytitle">sources.list</span>(5)</span>, <span class="citerefentry"><span class="refentrytitle">apt.conf</span>(5)</span>, and <span class="citerefentry"><span class="refentrytitle">apt_preferences</span>(5)</span>;
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">/usr/share/doc/apt-doc/guide.html/index.html</code>" and "<code class="literal">/usr/share/doc/apt-doc/offline.html/index.html</code>" from the <code class="literal">apt-doc</code> package; and
</p>
                    </li>
                    <li class="listitem">
                      <p>
"<code class="literal">/usr/share/doc/aptitude/html/en/index.html</code>" from the <code class="literal">aptitude-doc-en</code> package.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
Official and detailed documentations on the Debian archive:
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p><a class="ulink" href="http://www.debian.org/doc/debian-policy/ch-archive">"Debian Policy Manual Chapter 2 - The Debian Archive"</a>,
</p>
                    </li>
                    <li class="listitem">
                      <p><a class="ulink" href="http://www.debian.org/doc/manuals/developers-reference/resources.html#archive">"Debian Developer's Reference, Chapter 4 - Resources for Debian Developers 4.6 The Debian archive"</a>, and
</p>
                    </li>
                    <li class="listitem">
                      <p><a class="ulink" href="http://www.debian.org/doc/FAQ/ch-ftparchives">"The Debian GNU/Linux FAQ, Chapter 6 - The Debian FTP archives"</a>.
</p>
                    </li>
                  </ul>
                </div>
              </li>
              <li class="listitem">
                <p>
Tutorial for building of a Debian package for Debian users:
</p>
                <div class="itemizedlist">
                  <ul class="itemizedlist">
                    <li class="listitem">
                      <p><a class="ulink" href="http://www.debian.org/doc/manuals/maint-guide/">"Debian New Maintainers' Guide"</a>.
</p>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr/>
      <table width="100%" summary="Navigation footer">
        <tr>
          <td align="left"><a accesskey="p" href="ch01.en.html"><img src="images/prev.png" alt="Prev"/></a> </td>
          <td align="center"> </td>
          <td align="right"> <a accesskey="n" href="ch03.en.html"><img src="images/next.png" alt="Next"/></a></td>
        </tr>
        <tr>
          <td align="left" valign="top">Chapter 1. GNU/Linux tutorials </td>
          <td align="center">
            <a accesskey="h" href="index.en.html">
              <img src="images/home.png" alt="Home"/>
            </a>
          </td>
          <td align="right" valign="top"> Chapter 3. The system initialization</td>
        </tr>
      </table>
    </div>
  </body>
</html>