加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

dpkg-query命令是Debian linux中软件包的查询工具

发布时间:2023-06-13 07:01:45 所属栏目:Linux 来源:互联网
导读:   Linux常用命令dpkg-query命令是Debian linux中软件包的查询工具,它从dpkg软件包数据库中查询并显示软件包的信息,下面为大家分享一下Linux常用命令dpkg-query命令具体使用方法。
  Linux常用命令dpkg-query命令是Debian linux中软件包的查询工具,它从dpkg软件包数据库中查询并显示软件包的信息,下面为大家分享一下Linux常用命令dpkg-query命令具体使用方法。

  语法
 
   dpkg-query(选项)(参数)
 
  选项
 
   -l:列出符合匹配模式的软件包;
 
   -s:查询软件包的状态信息;
 
   -L:显示软件包所安装的文件列表;
 
   -S:从安装的软件包中查询文件;
 
   -w:显示软件包信息;
 
   -c:显示软件包的控制文件路径;
 
   -p:显示软件包的细节。
 
  参数
 
  软件包名称:指定需要查询的软件包。
 
  实例
 
  搜寻拥有该文件(或多个文件)的软件包
 
   deng@itcast:~/test$ dpkg-query -S tree
 
   libreoffice-help-zh-cn: /usr/share/libreoffice/help/zh-CN/shared.tree
 
   12
 
  列出ubuntu下所安装软件列表
 
   deng@itcast:~/test$ sudo dpkg-query -W --showformat='${Package} ${Version}\n' >> /tmp/txt
 
   deng@itcast:~/test$
 
   12
 
  显示软件包详尽的状态信息
 
   deng@itcast:~/test$ dpkg-query -s tree
 
   Package: tree
 
   Status: install ok installed
 
   Priority: optional
 
   Section: utils
 
   Installed-Size: 106
 
   Maintainer: Ubuntu Developers
 
   Architecture: amd64
 
   Version: 1.6.0-1
 
   Depends: libc6 (>= 2.4)
 
   Description: displays directory tree, in color
 
    Displays an indented directory tree, using the same color assignments as
 
    ls, via the LS_COLORS environment variable.
 
   Original-Maintainer: Florian Ernst
 
   Homepage: http://mama.indstate.edu/users/ice/tree/
 
   deng@itcast:~/test$
 
   12345678910111213141516
 
  查看软件包安装时安装到系统的文件列表
 
   deng@itcast:~/test$ dpkg-query -L tree
 
   /.
 
   /usr
 
   /usr/bin
 
   /usr/bin/tree
 
   /usr/share
 
   /usr/share/man
 
   /usr/share/man/man1
 
   /usr/share/man/man1/tree.1.gz
 
   /usr/share/doc
 
   /usr/share/doc/tree
 
   /usr/share/doc/tree/TODO
 
   /usr/share/doc/tree/copyright
 
   /usr/share/doc/tree/README.gz
 
   /usr/share/doc/tree/changelog.Debian.gz
 
   deng@itcast:~/test$
 

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!