Debian软件包信息查询

5.4.1 查看当前系统中的软件信息(dpkg -l)
"dpkg -l"命令用于查看当前系统中所有deb的软件包信息;通过"dpkg -l"命令与less和grep命令配合使用,可以实现更复杂的软件包信息查询功能。

debian:~/Desktop# dpkg -l
期望状态=未知(u)/安装(i)/删除(r )/清除(p)/保持(h)
| 当前状态=未(n)/已安装(i)/仅存配置(c )/仅解压缩(U)/配置失败(F)/不完全安装(H)
|/ 错误?=(无)/保持(?)/须重装(R )/两者兼有(#) (状态,错误:大写=故障)
||/ 名称 版本 简介
+++-====================================-=========================-============================================
ii acpi 0.09-1 displays information on ACPI devices
ii acpid 1.0.4-5 Utilities for using ACPI power management
ii adduser 3.87 Add and remove users and groups
ii alacarte 0.8-3 easy GNOME menu editing tool
ii alsa-base 1.0.11-2 ALSA driver configuration files
ii alsa-utils 1.0.11-4 ALSA utilities
ii antlr 2.7.6-6 language tool for constructing recognizers, 
ii apt 0.6.44.1 Advanced front-end for dpkg
ii apt-utils 0.6.44.1 APT utility programs
ii aptitude 0.4.1-1.1 terminal-based apt frontend
ii artsbuilder 3.5.3-1 synthesizer designer for aRts
ii at 3.1.10 Delayed job execution and batch processing
ii base-files 3.1.13 Debian base system miscellaneous files
ii base-passwd 3.5.11 Debian base system master password and group
ii bash 3.1-4 The GNU Bourne Again SHell
ii bc 1.06-19 The GNU bc arbitrary precision calculator la
ii bin86 0.16.14-1.4 16-bit x86 assembler and loader
ii bind9-host 9.3.2-2 Version of 'host' bundled with BIND 9.X



debian:~#dpkg -l | less

查询系统中与"vim"相关的软件包
debian:~#dpkg -l | grep -i vim 

5.4.2 查询已安装的指定软件包的详细信息(dpkg -s)
使用"dpkg -s"命令查询ssh软件包的详细信息

debian:~# dpkg -s ssh
Package: ssh
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 32
Maintainer: Matthew Vernon <matthew@debian.org>
Architecture: all
Source: openssh
Version: 1:4.3p2-2
Depends: openssh-client, openssh-server
Description: Secure shell client and server (transitional package)
This is a transitional package depending on both the OpenSSH client and
the OpenSSH server, which are now in separate packages. You may remove
it once the upgrade is complete and nothing depends on it.


5.4.3 查询系统中已安装的软件包所安装的文件(dpkg -L)


显示"ssh"软件包安装到系统的文件

debian:~# dpkg -L ssh
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/openssh-client
/usr/share/doc/ssh


5.4.4 查询系统中的某个文件属于哪个软件包(dpkg -S)

debian:~# dpkg -S /etc/init.d/networking
netbase: /etc/init.d/networking

文件"/etc/init.d/networking"属于名为"netbase"的软件包。

debian:~# dpkg -S /etc/passwd
dpkg:没有找到 /etc/passwd。

系统中许多文件不属于任何软件包,它们可能是用户或程序运行时建立的文件。









本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/271127,如需转载请自行联系原作者
上一篇:智能投顾中的基础核心,华尔街老司机手把手教你搭建智能资产配置模型


下一篇:从软件工程的角度写机器学习3——主要监督学习算法的工程性分析