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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>24. Source and Binary Packages</TITLE>
<META NAME="description" CONTENT="24. Source and Binary Packages">
<META NAME="keywords" CONTENT="rute">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="rute.css">
<LINK REL="next" HREF="node28.html">
<LINK REL="previous" HREF="node26.html">
<LINK REL="up" HREF="rute.html">
<LINK REL="next" HREF="node28.html">
</HEAD>
<BODY BGCOLOR=#FFFFFF >
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR><TD align=left bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-purchase.html"><FONT COLOR=white>Purchase</FONT></A>
</FONT>
</TD><TD align=center bgcolor="#000000">
<FONT COLOR=white>
Copyright © 2002 Paul Sheer. <A HREF="copying.html"><FONT COLOR=white>Click here for copying permissions.</FONT></A>
</FONT>
</TD><TD align=right bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-home.html"><FONT COLOR=white>Home</FONT></A>
</FONT>
</TD></TR>
<TR><TD colspan=2 align=left bgcolor="#ECEBF4">
<IMG SRC="va-btn-small-light-60.png">
</TD><TD align=right bgcolor="#ECEBF4">
<IMG SRC="sflogo2-steel-60.png">
</TD></TR>
</TABLE><BR>
<!--Navigation Panel-->
<A NAME="tex2html2245"
HREF="node28.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2241"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2235"
HREF="node26.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2243"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2246"
HREF="node28.html">25. Introduction to IP</A>
<B> Up:</B> <A NAME="tex2html2242"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2236"
HREF="node26.html">23. Shared Libraries</A>
  <B> <A NAME="tex2html2244"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html2247"
HREF="#SECTION002710000000000000000">24.1 Building GNU Source Packages</A>
<LI><A NAME="tex2html2248"
HREF="#SECTION002720000000000000000">24.2 RedHat and Debian Binary Packages</A>
<UL>
<LI><A NAME="tex2html2249"
HREF="#SECTION002721000000000000000">24.2.1 Package versioning</A>
<LI><A NAME="tex2html2250"
HREF="#SECTION002722000000000000000">24.2.2 Installing, upgrading, and deleting</A>
<LI><A NAME="tex2html2251"
HREF="#SECTION002723000000000000000">24.2.3 Dependencies</A>
<LI><A NAME="tex2html2252"
HREF="#SECTION002724000000000000000">24.2.4 Package queries</A>
<LI><A NAME="tex2html2253"
HREF="#SECTION002725000000000000000">24.2.5 File lists and file queries</A>
<LI><A NAME="tex2html2254"
HREF="#SECTION002726000000000000000">24.2.6 Package verification</A>
<LI><A NAME="tex2html2255"
HREF="#SECTION002727000000000000000">24.2.7 Special queries</A>
<LI><A NAME="tex2html2256"
HREF="#SECTION002728000000000000000">24.2.8 <TT>
<FONT COLOR="#0000ff">dpkg</FONT></TT>/<TT>
<FONT COLOR="#0000ff">apt</FONT></TT> versus <TT>
<FONT COLOR="#0000ff">rpm</FONT></TT></A>
</UL>
<LI><A NAME="tex2html2257"
HREF="#SECTION002730000000000000000">24.3 Source Packages</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION002700000000000000000">
24. Source and Binary Packages</A>
</H1>
<P>
<A NAME="chap:packages"></A>
<P>
In this chapter you will, first and foremost, learn to build packages from source,
building on your knowledge of <TT>
<FONT COLOR="#0000ff">Makefile</FONT></TT>s in Chapter
<A HREF="node25.html#chap:trivintroc">22</A>. Most packages, however, also come as <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT>
(RedHat) or <TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> (Debian) files, which are discussed further below.
<P>
<H1><A NAME="SECTION002710000000000000000">
24.1 Building GNU Source Packages</A>
</H1>
<P>
<A NAME="sec:gnupackages"></A>
<P>
Almost all packages originally come as <B>C</B> sources, <TT>
<FONT COLOR="#0000ff">tar</FONT></TT>ed and
available from one of the many public FTP sites, like
<TT>
<FONT COLOR="#0000ff">metalab.unc.edu</FONT></TT>. Thoughtful developers would have made their
packages <I>GNU standards compliant</I>. This means that un<TT>
<FONT COLOR="#0000ff">tar</FONT></TT>ring the
package will reveal the following files inside the top-level directory:
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">INSTALL</FONT></TT></STRONG></DT>
<DD>This is a standard document beginning with the line
``<TT>
<FONT COLOR="#0000ff">These are generic installation instructions.</FONT></TT>'' Since all GNU
packages are installed in the same way, this file should always be the same.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">NEWS</FONT></TT></STRONG></DT>
<DD>News of interest to users.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">README</FONT></TT></STRONG></DT>
<DD>Any essential information. This is usually an explanation
of what the package does, promotional material, and anything special that
need be done to install the package.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">COPYING</FONT></TT></STRONG></DT>
<DD>The GNU General Public License.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">AUTHORS</FONT></TT></STRONG></DT>
<DD>A list of major contributors.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">ChangeLog</FONT></TT></STRONG></DT>
<DD>A specially formatted list containing a history
of all changes ever done to the package, by whom, and on what date. Used
to track work on the package.
</DD>
</DL>
Being GNU standards compliant should also mean that the
package can be installed with only the three following commands:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>./configure</code><br>
<code>make</code><br>
<code>make install</code><br>
</FONT></TD></TR></TABLE><P>
It also <I>usually</I> means that packages will compile on
any U<SMALL>NIX</SMALL> system. Hence, this section should be a good guide to
getting L<SMALL>INUX</SMALL> software to work on non-L<SMALL>INUX</SMALL> machines.
<P>
An example will illustrate these steps. Begin by downloading
<TT>
<FONT COLOR="#0000ff">cooledit</FONT></TT> from <TT>
<FONT COLOR="#0000ff">metalab.unc.edu</FONT></TT> in the directory
<TT>
<FONT COLOR="#0000ff">/pub/Linux/apps/editors/X/cooledit</FONT></TT>, using <TT>
<FONT COLOR="#0000ff">ftp</FONT></TT>.
Make a directory <TT>
<FONT COLOR="#0000ff">/opt/src</FONT></TT> in which to build
such custom packages. Now run
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>cd /opt/src</code><br>
<code>tar -xvzf cooledit-3.17.2.tar.gz</code><br>
<code>cd cooledit-3.17.2</code><br>
</FONT></TD></TR></TABLE><P>
You will notice that most sources have the
name
<I>package</I><TT>
<FONT COLOR="#0000ff">-</FONT></TT><I>major</I><TT>
<FONT COLOR="#0000ff">.</FONT></TT><I>minor</I><TT>
<FONT COLOR="#0000ff">.</FONT></TT><I>patch</I><TT>
<FONT COLOR="#0000ff">.tar.gz</FONT></TT>.
The <I>major</I> version of the package is changed when the developers
make a substantial feature update or when they introduce incompatibilities to
previous versions. The minor version is usually updated when small features
are added. The patch number (also known as the patch <I>level</I>) is
updated whenever a new release is made and usually signifies bug fixes.
<P>
At this point you can apply any patches you may have. See Section <A HREF="node23.html#sec:applyingpatches">20.7.3</A>.
<P>
You can now <TT>
<FONT COLOR="#0000ff">./configure</FONT></TT> the package. The <TT>
<FONT COLOR="#0000ff">./configure</FONT></TT> script is
generated by <TT>
<FONT COLOR="#0000ff">autoconf</FONT></TT>--a package used by developers to create
<B>C</B> source that will compile on any type of U<SMALL>NIX</SMALL> system. The <TT>
<FONT COLOR="#0000ff">autoconf</FONT></TT>
package also contains the <I>GNU Coding Standards</I> to which all
software should comply. <FONT COLOR="#ffa500">[<TT>
<FONT COLOR="#0000ff">autoconf</FONT></TT> is the remarkable work of
David MacKenzie. I often hear the myth that U<SMALL>NIX</SMALL> systems have so
diverged that they are no longer compatible. The fact that sophisticated
software like <TT>
<FONT COLOR="#0000ff">cooledit</FONT></TT> (and countless others) compiles on almost any
U<SMALL>NIX</SMALL> machine should dispel this nonsense. There is also hype surrounding
developers ``porting'' commercial software from other U<SMALL>NIX</SMALL> systems to
L<SMALL>INUX</SMALL>. If they had written their software in the least bit properly to begin
with, there would be no porting to be done. In short, <I>all</I> L<SMALL>INUX</SMALL>
software runs on <I>all</I> U<SMALL>NIX</SMALL>s. The only exceptions are a few
packages that use some custom features of the L<SMALL>INUX</SMALL> kernel.]</FONT>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>./configure --prefix=/opt/cooledit</code><br>
</FONT></TD></TR></TABLE><P>
Here, <TT>
<FONT COLOR="#0000ff">--prefix</FONT></TT> indicates the top-level directory under which
the package will be installed. (See Section <A HREF="node20.html#sec:dirsuper">17.2</A>.). Always also
try
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>./configure --help</code><br>
</FONT></TD></TR></TABLE><P>
to see package-specific options.
<P>
Another trick sets compile options<A NAME="page:compileroptions"></A>:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>CFLAGS='-O2 -fomit-frame-pointer -s -pipe' ./configure --prefix=/opt/cooledit</code><br>
</FONT></TD></TR></TABLE><P>
<DL>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">-O2</FONT></TT></STRONG></DT>
<DD>Sets compiler optimizations to be
``as fast as possible without making the binary larger.''
(<TT>
<FONT COLOR="#0000ff">-O3</FONT></TT> almost never provides an advantage.)
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">-fomit-frame-pointer</FONT></TT></STRONG></DT>
<DD>Permits the compiler to use one extra register
that would normally be used for debugging. Use this option only when
you are absolutely sure you have no interest in analyzing any running
problems with the package.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">-s</FONT></TT></STRONG></DT>
<DD>Strips the object code. This reduces the size of the
object code by eliminating any debugging data.
</DD>
<DT><STRONG><TT>
<FONT COLOR="#0000ff">-pipe</FONT></TT></STRONG></DT>
<DD>Instructs not to use temporary files. Rather, use pipes to
feed the code through the different stages of compilation. This usually
speeds compilation.
</DD>
</DL>
<P>
Compile the package. This can take up to several hours depending
on the amount of code and your CPU power. <FONT COLOR="#ffa500">[<TT>
<FONT COLOR="#0000ff">cooledit</FONT></TT> will compile
in under 10 minutes on any entry-level machine at the time of writing.]</FONT>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>make</code><br>
</FONT></TD></TR></TABLE><P>
You can also run
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>make CFLAGS='-O0 -g'</code><br>
</FONT></TD></TR></TABLE><P>
if you decide that you would rather compile with debug support after all.
<P>
Install the package with
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>make install</code><br>
</FONT></TD></TR></TABLE><P>
A nice trick to install into a different subdirectory is <FONT COLOR="#ffa500">[Not always supported.]</FONT>:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>mkdir /tmp/cooledit</code><br>
<code>make install prefix=/tmp/cooledit</code><br>
</FONT></TD></TR></TABLE><P>
You can use these commands to pack up the completed build for un<TT>
<FONT COLOR="#0000ff">tar</FONT></TT>ing onto
a different system. You should, however, never try to run a package from a
directory different from the one it was <TT>
<FONT COLOR="#0000ff">--prefix</FONT></TT>ed to install into, since
most packages <I>compile in</I> this location and then access installed data from
beneath it.
<P>
Using a source package is often the best way to install when you want the
package to work the way the developers intended. You will also tend to find
more documentation, when vendors have neglected to include certain files.
<P>
<H1><A NAME="SECTION002720000000000000000">
24.2 RedHat and Debian Binary Packages</A>
</H1>
<P>
<A NAME="sec:binpackarpmdpkg"></A>
<P>
In this section, we place Debian examples inside parentheses,
<TT>
<FONT COLOR="#0000ff">(</FONT></TT> ... <TT>
<FONT COLOR="#0000ff">)</FONT></TT>. Since these are examples from actual
systems, they do not always correspond.
<P>
<H2><A NAME="SECTION002721000000000000000">
24.2.1 Package versioning</A>
</H2>
<P>
The package numbering for RedHat and Debian packages
is often as follows (although this is far from a rule):
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code><package-name>-<source-version>-<package-version>.<hardware-platform>.rpm</code><br>
<code>( <package-name>_<source-version>-<package-version>.deb )</code><br>
</FONT></TD></TR></TABLE><P>
For example,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>bash-1.14.7-22.i386.rpm</code><br>
<code>( bash_2.03-6.deb )</code><br>
</FONT></TD></TR></TABLE><P>
is the Bourne Again Shell you are using, major version 1,
minor
version 14, patch 7, package version 22, compiled for an Intel 386
processor. Sometimes, the Debian package will have the architecture appended
to the version number, in the above case, perhaps <TT>
<FONT COLOR="#0000ff">bash_2.03-6_i386.deb</FONT></TT>.
<P>
The <TT>
<FONT COLOR="#0000ff"><source-version></FONT></TT> is the version on the original
<TT>
<FONT COLOR="#0000ff">.tar</FONT></TT> file (as above). The <TT>
<FONT COLOR="#0000ff"><package-version></FONT></TT>,
also called the <I>release</I>,
refers to the <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT> file itself; in this case,
<TT>
<FONT COLOR="#0000ff">bash-1.14.7-22.i386.rpm</FONT></TT> has been packed together for the
<TT>
<FONT COLOR="#0000ff">8</FONT></TT>th time, possibly with minor improvements to the way it installs with
each new number. The <TT>
<FONT COLOR="#0000ff">i386</FONT></TT> is called the <I>architecture</I> and
could also be <TT>
<FONT COLOR="#0000ff">sparc</FONT></TT> for a <I>SPARC</I> <FONT COLOR="#ffa500">[Type of processor
used in Sun Microsystems workstations]</FONT> machine, <TT>
<FONT COLOR="#0000ff">ppc</FONT></TT> for a
<I>PowerPC</I> <FONT COLOR="#ffa500">[Another non-Intel workstation]</FONT>, <TT>
<FONT COLOR="#0000ff">alpha</FONT></TT> for a
<I>DEC Alpha</I> <FONT COLOR="#ffa500">[High-end 64 bit server/workstation]</FONT> machine, or
several others.
<P>
<H2><A NAME="SECTION002722000000000000000">
24.2.2 Installing, upgrading, and deleting</A>
</H2>
<P>
To install
a package, run the following command on the <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT> or
<TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> file:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -i mirrordir-0.10.48-1.i386.rpm</code><br>
<code>( dpkg -i mirrordir_0.10.48-2.deb )</code><br>
</FONT></TD></TR></TABLE><P>
Upgrading (Debian automatically chooses an upgrade
if the package is already present) can be done with the following command,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -U mirrordir-0.10.49-1.i386.rpm</code><br>
<code>( dpkg -i mirrordir_0.10.49-1.deb )</code><br>
</FONT></TD></TR></TABLE><P>
and then completely uninstalling with
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -e mirrordir</code><br>
<code>( dpkg --purge mirrordir )</code><br>
</FONT></TD></TR></TABLE><P>
With Debian, a package <TT>
<FONT COLOR="#0000ff">r</FONT></TT>emoval does not remove
configuration files, thus allowing you to revert to its current
setup if you later decide to reinstall:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>dpkg -r mirrordir</code><br>
</FONT></TD></TR></TABLE><P>
If you need to reinstall a package (perhaps because
of a file being corrupted), use
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -i --force python-1.6-2.i386.rpm</code><br>
</FONT></TD></TR></TABLE><P>
Debian reinstalls automatically if the package is present.
<P>
<H2><A NAME="SECTION002723000000000000000">
24.2.3 Dependencies</A>
</H2>
<P>
Packages often require other packages to already be installed in order to
work. The package database keeps track of these <I>dependencies</I>.
Often you will get an <TT>
<FONT COLOR="#0000ff">error: failed dependencies:</FONT></TT> (or
<TT>
<FONT COLOR="#0000ff">dependency problems</FONT></TT> for Debian) message when you try to install. This
means that other packages must be installed first. The same might happen
when you try to remove packages. If two packages mutually require each
other, you must place them both on the command-line at once when
installing. Sometimes a package requires something that is not essential or is
already provided by an equivalent package. For example, a program may
require
<TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT> to be installed even though
<TT>
<FONT COLOR="#0000ff">exim</FONT></TT> is an adequate substitute.
In such cases, the option <TT>
<FONT COLOR="#0000ff">--nodeps</FONT></TT> skips dependency checking.
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -i --nodeps <rpm-file></code><br>
<code>( dpkg -i --ignore-depends=<required-package> <deb-file> )</code><br>
</FONT></TD></TR></TABLE><P>
Note that Debian is far more fastidious about its dependencies;
override them only when you are sure what is going on underneath.
<P>
<H2><A NAME="SECTION002724000000000000000">
24.2.4 Package queries</A>
</H2>
<P>
<TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT> and <TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> packages are more than a way of
archiving files;
otherwise, we could just use <TT>
<FONT COLOR="#0000ff">.tar</FONT></TT> files. Each package has its file list
stored in a database that can be queried. The following are some of the more
useful queries that can be done. Note that these are queries on
<I>already</I> installed packages only:
<P>
To get a list of all packages (<TT>
<FONT COLOR="#0000ff">q</FONT></TT>uery <TT>
<FONT COLOR="#0000ff">a</FONT></TT>ll, <TT>
<FONT COLOR="#0000ff">l</FONT></TT>list),
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qa</code><br>
<code>( dpkg -l '*' )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
To search for a package name,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qa | grep <regular-expression></code><br>
<code>( dpkg -l <glob-expression> )</code><br>
</FONT></TD></TR></TABLE><P>
Try,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qa | grep util</code><br>
<code>( dpkg -l '*util*' )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
To query for the existence of a package, say, <TT>
<FONT COLOR="#0000ff">textutils</FONT></TT> (<TT>
<FONT COLOR="#0000ff">q</FONT></TT>uery, <TT>
<FONT COLOR="#0000ff">l</FONT></TT>ist),
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -q textutils</code><br>
<code>( dpkg -l textutils )</code><br>
</FONT></TD></TR></TABLE><P>
gives the name and version
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>textutils-2.0e-7</code><br>
<code>( ii textutils 2.0-2 The GNU text file processing utilities. )</code><br>
</FONT></TD></TR></TABLE><P>
To get info on a package (<TT>
<FONT COLOR="#0000ff">q</FONT></TT>uery <TT>
<FONT COLOR="#0000ff">i</FONT></TT>nfo, <TT>
<FONT COLOR="#0000ff">s</FONT></TT>tatus),
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qi <package></code><br>
<code>( dpkg -s <package> )</code><br>
</FONT></TD></TR></TABLE><P>
To list libraries and other packages required by a package,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qR <package></code><br>
<code>( dpkg -s <package> | grep Depends )</code><br>
</FONT></TD></TR></TABLE><P>
To list what other packages require this one (with Debian we can check
by attempting a removal with the <TT>
<FONT COLOR="#0000ff">--no-act</FONT></TT> option to merely test),
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -q --whatrequires <package></code><br>
<code>( dpkg --purge --no-act <package> )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H2><A NAME="SECTION002725000000000000000">
24.2.5 File lists and file queries</A>
</H2>
<P>
To get a file list contained by a package <FONT COLOR="#ffa500">[Once again,
<I>not</I> for files but packages already installed.]</FONT>,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -ql <package></code><br>
<code>( dpkg -L <package> )</code><br>
</FONT></TD></TR></TABLE><P>
Package file lists are especially useful for finding
what commands and documentation a package provides. Users
are often frustrated by a package that they ``don't know what to do with.''
Listing files owned by the package is where to start.
<P>
To find out what package a file belongs to,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qf <filename></code><br>
<code>( dpkg -S <filename> )</code><br>
</FONT></TD></TR></TABLE><P>
For example, <TT>
<FONT COLOR="#0000ff">rpm -qf /etc/rc.d/init.d/httpd</FONT></TT>
(or <TT>
<FONT COLOR="#0000ff">rpm -qf /etc/init.d/httpd</FONT></TT>) gives <TT>
<FONT COLOR="#0000ff">apache-mod_ssl-1.3.12.2.6.6-1</FONT></TT>
on my system, and <TT>
<FONT COLOR="#0000ff">rpm -ql fileutils-4.0w-3 | grep bin</FONT></TT> gives a list of
all other commands from <TT>
<FONT COLOR="#0000ff">fileutils</FONT></TT>. A trick to find all the sibling files of a
command in your <TT>
<FONT COLOR="#0000ff">PATH</FONT></TT> is:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -ql `rpm -qf \`which --skip-alias <command> \``</code><br>
<code>( dpkg -L `dpkg -S \`which <command> \` | cut -f1 -d:` )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H2><A NAME="SECTION002726000000000000000">
24.2.6 Package verification</A>
</H2>
<P>
<A NAME="sec:packageveri"></A>
<P>
You sometimes might want to query whether a package's files have been
modified since installation (possibly by a hacker or an incompetent
system administrator). To verify all packages is time consuming
but provides some very instructive output:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -V `rpm -qa`</code><br>
<code>( debsums -a )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
However, there is not yet a way of saying that the package
installed is the real package (see Section <A HREF="node47.html#sec:knownriskpack">44.3.2</A>).
To check this, you need to get your actual <TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> or <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT>
file and verify it with:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -Vp openssh-2.1.1p4-1.i386.rpm</code><br>
<code>( debsums openssh_2.1.1p4-1_i386.deb )</code><br>
</FONT></TD></TR></TABLE><P>
<P>
Finally, even if you have the package file, how can you be
absolutely sure that it is <I>the</I> package that the original
packager created, and not some Trojan substitution? Use the
<TT>
<FONT COLOR="#0000ff">md5sum</FONT></TT> command to check:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>md5sum openssh-2.1.1p4-1.i386.rpm</code><br>
<code>( md5sum openssh_2.1.1p4-1_i386.deb )</code><br>
</FONT></TD></TR></TABLE><P>
<TT>
<FONT COLOR="#0000ff">md5sum</FONT></TT> uses the <I>MD5</I> mathematical algorithm to calculate
a numeric <I>hash</I> value based on the file contents, in this
case,
<TT>
<FONT COLOR="#0000ff">8</FONT>
<FONT COLOR="#0000ff">e</FONT>
<FONT COLOR="#0000ff">8</FONT>
<FONT COLOR="#0000ff">d</FONT>
<FONT COLOR="#0000ff">8</FONT>
<FONT COLOR="#0000ff">e</FONT>
<FONT COLOR="#0000ff">9</FONT>
<FONT COLOR="#0000ff">5</FONT>
<FONT COLOR="#0000ff">d</FONT>
<FONT COLOR="#0000ff">b</FONT>
<FONT COLOR="#0000ff">7</FONT>
<FONT COLOR="#0000ff">f</FONT>
<FONT COLOR="#0000ff">d</FONT>
<FONT COLOR="#0000ff">e</FONT>
<FONT COLOR="#0000ff">9</FONT>
<FONT COLOR="#0000ff">9</FONT>
<FONT COLOR="#0000ff">c</FONT>
<FONT COLOR="#0000ff">0</FONT>
<FONT COLOR="#0000ff">9</FONT>
<FONT COLOR="#0000ff">e</FONT>
<FONT COLOR="#0000ff">1</FONT>
<FONT COLOR="#0000ff">3</FONT>
<FONT COLOR="#0000ff">9</FONT>
<FONT COLOR="#0000ff">8</FONT>
<FONT COLOR="#0000ff">e</FONT>
<FONT COLOR="#0000ff">4</FONT>
<FONT COLOR="#0000ff">d</FONT>
<FONT COLOR="#0000ff">d</FONT>
<FONT COLOR="#0000ff">3</FONT>
<FONT COLOR="#0000ff">4</FONT>
<FONT COLOR="#0000ff">6</FONT>
<FONT COLOR="#0000ff">8</FONT></TT>.
This is identical to password hashing described on page
<A HREF="node14.html#page:passwdhash"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>. There is no feasible computational
method of forging a package to give the same MD5 hash; hence,
packagers will often publish their <TT>
<FONT COLOR="#0000ff">md5sum</FONT></TT> results on their web
page, and you can check these against your own as a security
measure.
<P>
<H2><A NAME="SECTION002727000000000000000">
24.2.7 Special queries</A>
</H2>
<P>
To query a package file that has not been installed, use,
for example:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qp --qf '[%{VERSION}\n]' <rpm-file></code><br>
<code>( dpkg -f <deb-file> Version )</code><br>
</FONT></TD></TR></TABLE><P>
Here, <TT>
<FONT COLOR="#0000ff">VERSION</FONT></TT> is a query <I>tag</I> applicable to <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT>
files. Here is a list of other tags that can be queried:
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=1 BORDER="1">
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">BUILDHOST</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">OBSOLETES</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RPMTAG_PREUN</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">BUILDTIME</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">OS</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RPMVERSION</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">CHANGELOG</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">PACKAGER</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">SERIAL</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">CHANGELOGTEXT</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">PROVIDES</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">SIZE</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">CHANGELOGTIME</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RELEASE</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">SOURCERPM</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">COPYRIGHT</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">REQUIREFLAGS</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">SUMMARY</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">DESCRIPTION</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">REQUIRENAME</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">VENDOR</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">DISTRIBUTION</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">REQUIREVERSION</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">VERIFYSCRIPT</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">GROUP</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RPMTAG_POSTIN</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">VERSION</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">LICENSE</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RPMTAG_POSTUN</FONT></TT></TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">NAME</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">RPMTAG_PREIN</FONT></TT></TD>
<TD ALIGN="LEFT"> </TD>
</TR>
</TABLE>
</DIV>
<P>
For Debian, <TT>
<FONT COLOR="#0000ff">Version</FONT></TT> is a <I>control field</I>. Others are
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=1 BORDER="1">
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Conffiles</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Maintainer</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Replaces</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Conflicts</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Package</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Section</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Depends</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Pre-Depends</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Source</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Description</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Priority</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Status</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Essential</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Provides</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Suggests</FONT></TT></TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Installed-Size</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Recommends</FONT></TT></TD>
<TD ALIGN="LEFT"><TT>
<FONT COLOR="#0000ff">Version</FONT></TT></TD>
</TR>
</TABLE>
</DIV>
<P>
It is further possible to extract all scripts, config, and control
files from a <TT>
<FONT COLOR="#0000ff">.deb</FONT></TT> file with:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>dpkg -e <deb-file> <out-directory></code><br>
</FONT></TD></TR></TABLE><P>
This command creates a directory <TT>
<FONT COLOR="#0000ff"><out-directory></FONT></TT>
and places the files in it. You can also dump the package as a <TT>
<FONT COLOR="#0000ff">tar</FONT></TT> file
with:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>dpkg --fsys-tarfile <deb-file></code><br>
</FONT></TD></TR></TABLE><P>
or for an <TT>
<FONT COLOR="#0000ff">.rpm</FONT></TT> file,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm2cpio <rpm-file></code><br>
</FONT></TD></TR></TABLE><P>
<P>
Finally, package file lists can be queried with
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>rpm -qip <rpm-file></code><br>
<code>( dpkg -I <deb-file> )</code><br>
<code>rpm -qlp <rpm-file></code><br>
<code>( dpkg -c <deb-file> )</code><br>
</FONT></TD></TR></TABLE><P>
which is analogous to similar queries on already installed packages.
<P>
<H2><A NAME="SECTION002728000000000000000">
24.2.8 <TT>
<FONT COLOR="#0000ff">dpkg</FONT></TT>/<TT>
<FONT COLOR="#0000ff">apt</FONT></TT> versus <TT>
<FONT COLOR="#0000ff">rpm</FONT></TT></A>
</H2>
<P>
Only a taste of Debian package management was provided above. Debian
has two higher-level tools: APT (<I>Advanced Package Tool</I>--which comprises
the commands <TT>
<FONT COLOR="#0000ff">apt-cache</FONT></TT>,
<TT>
<FONT COLOR="#0000ff">apt-cdrom</FONT></TT>,
<TT>
<FONT COLOR="#0000ff">apt-config</FONT></TT>,
and <TT>
<FONT COLOR="#0000ff">apt-get</FONT></TT>); and <TT>
<FONT COLOR="#0000ff">dselect</FONT></TT>, which is an
interactive text-based package selector. When you first install Debian,
I suppose the first thing you are supposed to do is run <TT>
<FONT COLOR="#0000ff">dselect</FONT></TT>
(there are other graphical front-ends--search on
<EM>Fresh Meat</EM> <I><<TT><A NAME="tex2html33"
HREF="http://freshmeat.net/">http://freshmeat.net/</A></TT>></I>), and then install and configure
all the things you skipped over during installation. Between these you can
do some sophisticated time-saving things like recursively resolving package
dependencies through automatic downloads--that is, just mention the
package and APT will find it and what it depends on, then download and
install everything for you. See <TT>
<FONT COLOR="#0000ff">apt</FONT></TT>(8), <TT>
<FONT COLOR="#0000ff">sources.list</FONT></TT>(5), and
<TT>
<FONT COLOR="#0000ff">apt.conf</FONT></TT>(5) for more information.
<P>
There are also numerous interactive graphical applications for
managing RPM packages. Most are purely cosmetic.
<P>
Experience will clearly demonstrate the superiority of Debian
packages over most others. You will also notice that where RedHat-like
distributions have chosen a selection of packages that they thought
<I>you</I> would find useful, Debian has hundreds of volunteer
maintainers selecting what <I>they</I> find useful. Almost every free
U<SMALL>NIX</SMALL> package on the Internet has been included in Debian.
<P>
<H1><A NAME="SECTION002730000000000000000">
24.3 Source Packages -- Building RedHat and Debian Packages</A>
</H1>
<P>
Both RedHat and Debian binary packages begin life as source files from
which their binary versions are compiled. Source RedHat packages will
end in <TT>
<FONT COLOR="#0000ff">.src.rpm</FONT></TT>, and Debian packages will always appear under
the source tree in the distribution. The <TT>
<FONT COLOR="#0000ff">RPM-HOWTO</FONT></TT> details the
building of RedHat source packages, and Debian's <TT>
<FONT COLOR="#0000ff">dpkg-dev</FONT></TT> and
<TT>
<FONT COLOR="#0000ff">packaging-manual</FONT></TT> packages contain a complete reference to the
Debian package standard and packaging methods (try
<TT>
<FONT COLOR="#0000ff">dpkg -L dpkg-dev</FONT></TT> and <TT>
<FONT COLOR="#0000ff">dpkg -L packaging-manual</FONT></TT>).
<P>
The actual building of RedHat and Debian source packages
is not covered in this edition.
<P>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2245"
HREF="node28.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2241"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2235"
HREF="node26.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2243"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2246"
HREF="node28.html">25. Introduction to IP</A>
<B> Up:</B> <A NAME="tex2html2242"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2236"
HREF="node26.html">23. Shared Libraries</A>
  <B> <A NAME="tex2html2244"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
</BODY>
</HTML>
|