有时候需要单独解压Debian的某个.deb软件包,使用 dpkg-deb 和 ar 命令就可以完成这项任务,虽然两者的运行方式不一样。ar是把deb软件包解压为压缩包,需要我们再次解压。而dpkg-deb则直接释放所有的文件。
使用dpkg-deb命令,把debootrap包解压到当前目录下的test目录(无需事先创建test目录):
dpkg-deb -x debootstrap_1.0.10lenny1_all.deb ./test
使用ar命令:
ar xv debootstrap_1.0.10lenny1_all.deb x - debian-binary x - control.tar.gz x - data.tar.gz
其中control.tar.gz用于控制debootrap这个包的运行状态,包括md5sum值的比对。而data.tar.gz这个包就是实际的系统文件。