首先安装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
查找命令所在的包:
# dpkg -S /usr/bin/ascii
下载包的源码:
当前目录下面既可以看到源码已经下载
# ls