如何经过apt-get得到安装包的源码

有时候咱们须要得到某个可执行程序的源码,而不单单是一个可执行程序,好比咱们想获取tree这个工具的源码,这时候就能够采用下面的命令:git

 

sudo apt-get source treeapp

 

pengdl@debian:~$ sudo apt-get source tree Reading package lists... Done Building dependency tree Reading state information... Done NOTICE: 'tree' packaging is maintained in the 'Git' version control system at: git://git.debian.org/collab-maint/tree.git
Need to get 49.8 kB of source archives. Get:1 http://mirrors.163.com/debian/ wheezy/main tree 1.6.0-1 (dsc) [1,145 B]
Get:2 http://mirrors.163.com/debian/ wheezy/main tree 1.6.0-1 (tar) [42.7 kB]
Get:3 http://mirrors.163.com/debian/ wheezy/main tree 1.6.0-1 (diff) [5,916 B]
Fetched 49.8 kB in 0s (78.9 kB/s) gpgv: keyblock resource `/root/.gnupg/trustedkeys.gpg': file open error
gpgv: Signature made Sat 04 Feb 2012 08:33:55 AM EST using DSA key ID 514B3E7C gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./tree_1.6.0-1.dsc dpkg-source: info: extracting tree in tree-1.6.0 dpkg-source: info: unpacking tree_1.6.0.orig.tar.gz dpkg-source: info: unpacking tree_1.6.0-1.debian.tar.gz dpkg-source: info: applying 01_Makefile_fix dpkg-source: info: applying 02_PATH_MAX

 

执行完成以后,就会在当前目录生成以下几个文件:工具

tree-1.6.0
tree_1.6.0-1.dsc
tree_1.6.0-1.debian.tar.gz
tree_1.6.0.orig.tar.gz ui

其中目录tree-1.6.0中就是想要的tree的源码了,根据其中的提示能够手工编译生成目标机器上的tree命令。spa

相关文章
相关标签/搜索