Linux常用命令dpkg-query怎么用


这篇文章主要为大家展示了“Linux常用命令dpkg-query怎么用”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux常用命令dpkg-query怎么用”这篇文章吧。

Linux常用命令dpkg-query命令是Debian linux中软件包的查询工具,它从dpkg软件包数据库中查询并显示软件包的信息。

语法

 dpkg-query(选项)(参数)

选项

 -l:列出符合匹配模式的软件包; -s:查询软件包的状态信息; -L:显示软件包所安装的文件列表; -S:从安装的软件包中查询文件; -w:显示软件包信息; -c:显示软件包的控制文件路径; -p:显示软件包的细节。

参数

软件包名称:指定需要查询的软件包。

实例

搜寻拥有该文件(或多个文件)的软件包

 deng@itcast:~/test$ dpkg-query -S tree libreoffice-help-zh: /usr/share/libreoffice/help/zh/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: 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$

以上是“Linux常用命令dpkg-query怎么用”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注主机评测网行业资讯频道!


上一篇:Linux常用命令dpkg-preconfigure怎么用

下一篇:Python中怎么使用pdm管理项目库环境


Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器