天天看點

Debian軟體包資訊查詢

<b>5.4.1 檢視目前系統中的軟體資訊(dpkg -l)</b>

"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 

<b>5.4.2 查詢已安裝的指定軟體包的詳細資訊(dpkg -s)</b>

使用"dpkg -s"指令查詢ssh軟體包的詳細資訊

debian:~# dpkg -s ssh

Package: ssh

Status: install ok installed

Priority: extra

Section: net

Installed-Size: 32

Maintainer: Matthew Vernon &lt;[email protected]&gt;

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.

<b></b>

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,如需轉載請自行聯系原作者

繼續閱讀