Changes between Initial Version and Version 1 of DissectingAPackage


Ignore:
Timestamp:
01/23/13 16:09:56 (11 years ago)
Author:
jdreed
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DissectingAPackage

    v1 v1  
     1= Dissecting A Package = 
     2 
     3Now that we have a package, let's take a look inside it. 
     4 
     5A Debian package is merely a specialized version of an older archive format, known as `ar`.  The `ar` command is used to manipulate these types of archives.  Let's extract a `.deb` archive: 
     6 
     7{{{ 
     8$ ar xv rpncalc_0.1_amd64.deb  
     9x - debian-binary 
     10x - control.tar.gz 
     11x - data.tar.gz 
     12}}} 
     13 
     14Here, we told the `ar` command to extract (`x`) in verbose mode (`v`) the `.deb` file.  It successfully extracted 3 items.  Let's take a look at them: 
     15 
     16* debian-binary: The presence of this file identifies this as a binary Debian package, and its contents (in this case, "2.0"), identifies as version 2 of the format. 
     17* control.tar.gz and data.tar.gz: These are yet more archives, in tar ("TApe aRchive") format, compressed with Gzip ("gz").  We can take a look at what's inside them with this command: 
     18 
     19{{{ 
     20$ tar tzvf control.tar.gz  
     21drwxr-xr-x root/root         0 2013-01-23 15:37 ./ 
     22-rw-r--r-- root/root       248 2013-01-23 15:37 ./md5sums 
     23-rw-r--r-- root/root       304 2013-01-23 15:37 ./control 
     24$ tar tzvf data.tar.gz  
     25drwxr-xr-x root/root         0 2013-01-23 15:37 ./ 
     26drwxr-xr-x root/root         0 2013-01-23 15:37 ./usr/ 
     27drwxr-xr-x root/root         0 2013-01-23 15:37 ./usr/share/ 
     28drwxr-xr-x root/root         0 2013-01-23 15:37 ./usr/share/doc/ 
     29drwxr-xr-x root/root         0 2013-01-23 15:37 ./usr/share/doc/rpncalc/ 
     30-rw-r--r-- root/root       163 2013-01-23 15:30 ./usr/share/doc/rpncalc/copyright 
     31-rw-r--r-- root/root       136 2013-01-23 15:33 ./usr/share/doc/rpncalc/changelog.gz 
     32-rw-r--r-- root/root       310 2013-01-23 15:37 ./usr/share/doc/rpncalc/README 
     33drwxr-xr-x root/root         0 2013-01-23 15:37 ./usr/bin/ 
     34-rwxr-xr-x root/root       578 2013-01-23 15:37 ./usr/bin/rpncalc 
     35}}} 
     36 
     37== control.tar.gz == 
     38 
     39This contains the package's "control" information, or metadata.  In this case, it contains the two files: `md5sums` and `control`.  Let's take a look at them: 
     40 
     41{{{ 
     42$ tar xzvf control.tar.gz  
     43./ 
     44./md5sums 
     45./control 
     46}}} 
     47 
     48=== md5sums === 
     49 
     50`md5sums` contains the MD5 checksums of the files in the package.  These are used to verify the integrity of these files when the package is unpacked, and also can be used later by the system administrator to verify that they haven't been changed since the package was installed. 
     51 
     52{{{ 
     53$ cat md5sums  
     5484ab9c5699930934aa485a7e1e977ad7  usr/bin/rpncalc 
     5543ae450d42636f929f4c8d6fcaf3b77f  usr/share/doc/rpncalc/README 
     56dd9cb407332a29aae18ee26cc6c5346c  usr/share/doc/rpncalc/changelog.gz 
     5776a03e152d5ca56ba30707781d20d458  usr/share/doc/rpncalc/copyright 
     58}}} 
     59 
     60You can verify individual checksums yourself with the `md5sum` command. 
     61 
     62=== control === 
     63 
     64{{{ 
     65Package: rpncalc 
     66Version: 0.1 
     67Architecture: amd64 
     68Maintainer: Jonathan Reed <jdreed@mit.edu> 
     69Installed-Size: 30 
     70Section: utils 
     71Priority: extra 
     72Description: Simple RPN calculator in bash 
     73 A simple RPN calculator, implemented in bash. 
     74 Not legal for trade. 
     75 This was taken from the O'Reilly bash cookbook. 
     76}}} 
     77 
     78The control information contains metadata about the package. 
     79 
     80