3 | | Now that we have a package, let's take a look inside it. |
| 3 | Given a `.deb` package, the `dpkg-deb` command will tell us a bit about it: |
| 4 | |
| 5 | {{{ |
| 6 | $ dpkg-deb -I rpncalc_0.1_amd64.deb |
| 7 | new debian package, version 2.0. |
| 8 | size 1854 bytes: control archive= 515 bytes. |
| 9 | 304 bytes, 11 lines control |
| 10 | 248 bytes, 4 lines md5sums |
| 11 | Package: rpncalc |
| 12 | Version: 0.1 |
| 13 | Architecture: amd64 |
| 14 | Maintainer: Jonathan Reed <jdreed@mit.edu> |
| 15 | Installed-Size: 30 |
| 16 | Section: utils |
| 17 | Priority: extra |
| 18 | Description: Simple RPN calculator in bash |
| 19 | A simple RPN calculator, implemented in bash. |
| 20 | Not legal for trade. |
| 21 | This was taken from the O'Reilly bash cookbook. |
| 22 | }}} |
| 23 | |
| 24 | Here we can see some basic information about the size, name, version, and other metadata. |
| 25 | |
| 26 | We can also extract the contents of the package into a temporary directory ("scratch"): |
| 27 | |
| 28 | {{{ |
| 29 | $ mkdir scratch |
| 30 | $ dpkg-deb -x rpncalc_0.1_amd64.deb scratch |
| 31 | $ cd scratch/ |
| 32 | $ ls |
| 33 | usr |
| 34 | $ tree |
| 35 | . |
| 36 | └── usr |
| 37 | ├── bin |
| 38 | │ └── rpncalc |
| 39 | └── share |
| 40 | └── doc |
| 41 | └── rpncalc |
| 42 | ├── changelog.gz |
| 43 | ├── copyright |
| 44 | └── README |
| 45 | |
| 46 | 5 directories, 4 files |
| 47 | }}} |
| 48 | |
| 49 | So now we have the contents in a temporary directory, and we could explore them and maybe try and run the binaries. |
| 50 | |
| 51 | Now let's dig a bit deeper into how the package is put together: |