Signs of Triviality

Opinions, mostly my own, on the importance of being and other things.
[homepage] [index] [] [@jschauma] [RSS]

Extracting a file from a .deb

A debian package (.deb) is nothing but an ar(1) archive, so you can use ar(1) to extract files from it. The actual files contained in the .deb are stored in the data.tar.gz archive within the .deb.

Example: Suppose you hosed your Debian Linux machine's /lib/ To retrieve this file from the official Debian package, fetch the file Packages from your mirrors dists/woody/main/binary-i386 directory. From that file, you can determine that the proper debian package to fetch is pool/main/g/glibc/libc6_2.2.5-11.8_i386.deb. Download that file and extract the correct libc:

$ ar x libc6_2.2.5-11.8_i386.deb
$ tar zxf data.tar.gz ./lib/

Boot your hosed machine from a rescue or install floppy/CD, mount the filesystem and copy the new file into place. Reboot. Voilà, all's peachy again.

July 15, 2005

[New York State of Mind] [index] [Don't lock yourself out]