安装包管理 apt-get

  • apt-cache search tclcurl 查找程序包
  • apt-cache show tclcurl 查看程序包的描述信息
  • apt-cache policy tclcurl 查看程序包的版本信息
  • apt-get install tclcurl 安装程序包

最常见的情况就是直接运行sudo apt-get install命令来安装程序包。

需要检查确认程序包的版本信息等,使用命令apt-cache

apt-cache

以"tclcurl"为例,apt-cache的使用情况如下:

% apt-cache search tclcurl
tclcurl - Tcl bindings to libcurl

% apt-cache policy tclcurl
tclcurl:
  Installed: 7.22.0-1
  Candidate: 7.22.0-1
  Version table:
 *** 7.22.0-1 0
        500 http://mirrors.ustc.edu.cn/debian/ wheezy/main i386 Packages
        100 /var/lib/dpkg/status

% apt-cache show tclcurl
Package: tclcurl
Version: 7.22.0-1
Installed-Size: 210
Maintainer: Sven Hoexter <[email protected]>
Architecture: i386
Depends: libc6 (>= 2.4), libcurl3-gnutls (>= 7.18.0), tcl (>= 8.5.0-1) | tclsh
Suggests: libcurl4-gnutls-dev
Description-en: Tcl bindings to libcurl
 This module enables the use of libcurl in Tcl scripts. Please refer to
 the libcurl documentation available in the libcurl4-gnutls-dev package.
 .
 NOTE: the SSL support is provided by GnuTLS.
Homepage: http://personal.telefonica.terra.es/web/getleft/tclcurl/index.html
Description-md5: 14561541206fa213a6c0490f9da8a0c8
Tag: devel::lang:tcl, devel::library, implemented-in::tcl, protocol::ftp,
 protocol::http, protocol::ssl, role::shared-lib
Section: interpreters
Priority: extra
Filename: pool/main/t/tclcurl/tclcurl_7.22.0-1_i386.deb
Size: 93354
MD5sum: 30a6890624d26bb87031dba72aeffc7b
SHA1: 20baf0a1aae2fcbc767bbc7aedecdfb2499aa530
SHA256: 26ad4c40212263b1dd567a694b9a5b2bc9a627852115b54e381cc0b38e02f306

安装源代码

首先确认安装了apt-src。如果没有,安装配置如下:

% apt-get install apt-src

% cat /etc/apt/sources.list
...
deb-src http://ftp.debian.org/debian wheezy main
...

// 参考:https://wiki.debian.org/apt-src

安装源码文件

比如要安装TclCurl的源代码:

% apt-src install tclcurl

% ls -l
-rw-r--r-- 1 root root  10435 Jun  2  2012 tclcurl_7.22.0-1.diff.gz
-rw-r--r-- 1 root root   1891 Jun  2  2012 tclcurl_7.22.0-1.dsc
-rw-r--r-- 1 root root 236334 Jun  2  2012 tclcurl_7.22.0.orig.tar.gz
drwxr-xr-x 8 root root   4096 Nov 21 09:08 tclcurl-7.22.0/