feisky

云计算、虚拟化与Linux技术笔记
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

如何下载Ubuntu命令对应的源码

Posted on 2012-02-05 14:43  feisky  阅读(946)  评论(0编辑  收藏  举报

首先安装dpkg-dev:

apt-get install dpkg-dev 

 

设置源,将原来的源复制,但把deb改为deb-src:

#vim /etc/apt/sources.list

deb http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse

 并执行apt-get update

 

得到命令的全路径:

# which ascii

/usr/bin/ascii

 

 查找命令所在的包:

 # dpkg -S /usr/bin/ascii

ascii: /usr/bin/ascii

 

 下载包的源码:

# apt-get source ascii

当前目录下面既可以看到源码已经下载 

 # ls

ascii-3.8  ascii_3.8-4.diff.gz  ascii_3.8-4.dsc  ascii_3.8.orig.tar.gz
无觅相关文章插件,快速提升流量