debian源码包管理的几个有用的命令

来源:互联网 发布:ipad air淘宝清除缓存 编辑:程序博客网 时间:2024/05/17 22:27

本文参考文章的网址:

http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.zh-cn.html  (源码包操作)

http://www.debian.org/doc/manuals/apt-howto/ch-search.zh-cn.html                (获取软件包信息)

本文介绍的命令是:

apt-get soure PROGRAME_NAME                      (普通用户)

apt-get build-dep PROGRAME_NAME                (root用户)

apt-cache show   PROGRAME_NAME                 (普通用户)

以sysvinit工程为例,介绍以上3个命令。

1、apt-get soure PROGRAME_NAME

administrator@wangjk:~/sysvinit$ apt-get source sysvinit
Reading package lists... Done
Building dependency tree... Done
Need to get 235kB of source archives.
Get:1 http://ftp.tw.debian.org etch/main sysvinit 2.86.ds1-38+etchnhalf.1 (dsc) [992B]
Get:2 http://ftp.tw.debian.org etch/main sysvinit 2.86.ds1-38+etchnhalf.1 (tar) [98.6kB]
Get:3 http://ftp.tw.debian.org etch/main sysvinit 2.86.ds1-38+etchnhalf.1 (diff) [136kB]                           
Fetched 235kB in 53s (4381B/s)                                                                                     
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "US_en"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
gpg: can't open `/gnupg/options.skel': No such file or directory
gpg: Signature made Tue May 20 00:30:21 2008 CST using DSA key ID 19A42D19
gpg: Can't check signature: public key not found
dpkg-source: extracting sysvinit in sysvinit-2.86.ds1
dpkg-source: unpacking sysvinit_2.86.ds1.orig.tar.gz
dpkg-source: applying ./sysvinit_2.86.ds1-38+etchnhalf.1.diff.gz
administrator@wangjk:~/sysvinit$ ls
sysvinit-2.86.ds1                         sysvinit_2.86.ds1-38+etchnhalf.1.dsc
sysvinit_2.86.ds1-38+etchnhalf.1.diff.gz  sysvinit_2.86.ds1.orig.tar.gz
2、apt-get build-dep PROGRAME_NAME

wangjk:/home/administrator/sysvinit# apt-get build-dep sysvinit
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  build-essential dpatch g++ g++-4.1 libc6-dev libselinux1-dev libsepol1-dev libstdc++6-4.1-dev
  linux-kernel-headers
0 upgraded, 9 newly installed, 0 to remove and 17 not upgraded.
Need to get 9670kB of archives.
After unpacking 41.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.tw.debian.org etch/main linux-kernel-headers 2.6.18-7 [1875kB]
Get:2 http://ftp.tw.debian.org etch/main libc6-dev 2.3.6.ds1-13etch9+b1 [2718kB]                                   
Get:3 http://ftp.tw.debian.org etch/main libstdc++6-4.1-dev 4.1.1-21 [1634kB]                                      
Get:4 http://ftp.tw.debian.org etch/main g++-4.1 4.1.1-21 [2615kB]                                                 
Get:5 http://ftp.tw.debian.org etch/main g++ 4:4.1.1-15 [1360B]                                                    
Get:6 http://ftp.tw.debian.org etch/main build-essential 11.3 [6982B]                                              
Get:7 http://ftp.tw.debian.org etch/main dpatch 2.0.21 [83.5kB]                                                    
Get:8 http://ftp.tw.debian.org etch/main libsepol1-dev 1.14-2 [533kB]                                              
Get:9 http://ftp.tw.debian.org etch/main libselinux1-dev 1.32-3 [204kB]                                            
Fetched 9670kB in 2m12s (72.9kB/s)                                                                                 
Selecting previously deselected package linux-kernel-headers.
(Reading database ... 74266 files and directories currently installed.)
Unpacking linux-kernel-headers (from .../linux-kernel-headers_2.6.18-7_i386.deb) ...
Selecting previously deselected package libc6-dev.
Unpacking libc6-dev (from .../libc6-dev_2.3.6.ds1-13etch9+b1_i386.deb) ...
Selecting previously deselected package libstdc++6-4.1-dev.
Unpacking libstdc++6-4.1-dev (from .../libstdc++6-4.1-dev_4.1.1-21_i386.deb) ...
Selecting previously deselected package g++-4.1.
Unpacking g++-4.1 (from .../g++-4.1_4.1.1-21_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4%3a4.1.1-15_i386.deb) ...
Selecting previously deselected package build-essential.
Unpacking build-essential (from .../build-essential_11.3_i386.deb) ...
Selecting previously deselected package dpatch.
Unpacking dpatch (from .../archives/dpatch_2.0.21_all.deb) ...
Selecting previously deselected package libsepol1-dev.
Unpacking libsepol1-dev (from .../libsepol1-dev_1.14-2_i386.deb) ...
Selecting previously deselected package libselinux1-dev.
Unpacking libselinux1-dev (from .../libselinux1-dev_1.32-3_i386.deb) ...
Setting up linux-kernel-headers (2.6.18-7) ...
Setting up libc6-dev (2.3.6.ds1-13etch9+b1) ...
Setting up dpatch (2.0.21) ...
Setting up libsepol1-dev (1.14-2) ...
Setting up libselinux1-dev (1.32-3) ...
Setting up libstdc++6-4.1-dev (4.1.1-21) ...
Setting up g++-4.1 (4.1.1-21) ...
Setting up g++ (4.1.1-15) ...

Setting up build-essential (11.3) ...
3、apt-cache show   PROGRAME_NAME

wangjk:/home/administrator/sysvinit# apt-cache show sysvinit
Package: sysvinit
Essential: yes
Priority: required
Section: admin
Installed-Size: 220
Maintainer: Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Architecture: i386
Version: 2.86.ds1-38+etchnhalf.1
Depends: libc6 (>= 2.3.6-6), libselinux1 (>= 1.32), libsepol1 (>= 1.14)
Pre-Depends: initscripts, sysv-rc (>= 2.86.ds1-1.2) | file-rc (>> 0.7.0), sysvinit-utils
Filename: pool/main/s/sysvinit/sysvinit_2.86.ds1-38+etchnhalf.1_i386.deb
Size: 108090
MD5Sum: 90ee9eb01fb5ffe97213d6f00183ae0b
SHA1: fe4d5d4ed1d2a48f85753872f8752806a1cdb519
SHA256: 96a83b2076b15bb318fc5b9c0d666a01436d9396da63082695815ddc172ac339
Description: System-V-like init utilities
 This package contains programs required for booting
 a Debian system and doing basic process management.
 .
 The most important program in the package is /sbin/init.
 It is the first process started on boot and continues
 to run as process number 1 until the system halts. All
 other processes are descended from it.

原创粉丝点击