查找在 Ubuntu 11.10 中提供工具/应用程序的包

Bru*_*ira 3 command-line apt 11.10

可能重复:
如何找到提供文件的包?

当您在 Ubuntu 的终端中键入一个您尚未安装但可以由软件包提供的命令时,Ubuntu 将建议安装该软件包。

反过来我怎么做?如何查找提供了我在终端中输入的命令的软件包?

dpkg -S /usr/bin/termit

返回

termit: /usr/bin/termit
Run Code Online (Sandbox Code Playgroud)


apt 文件查找 /usr/bin/termit

返回

termit: /usr/bin/termit
Run Code Online (Sandbox Code Playgroud)

termitpackage 提供的终端模拟器在哪里termit

在此处输入图片说明

bst*_*rre 5

如果您已经apt-file安装并配置好了,您可以执行以下操作:

apt-file find <filename>
Run Code Online (Sandbox Code Playgroud)

当您要查找尚未安装的命令时,这也很方便,例如,如果您按照 Web 上看到的使用您没有的命令的说明进行工作。

如果只想查询已安装的包,可以使用:

dpkg -S <pattern>
Run Code Online (Sandbox Code Playgroud)

例如,对于已安装的文件:

% apt-file find /usr/bin/oodraw
openoffice.org-draw: /usr/bin/oodraw
% dpkg -S oodraw
openoffice.org-draw: /usr/share/man/man1/oodraw.1.gz
openoffice.org-draw: /usr/bin/oodraw
Run Code Online (Sandbox Code Playgroud)

对于未安装的文件:

% dpkg -S /usr/bin/python3.1
dpkg: /usr/bin/python3.1 not found.
% apt-file find /usr/bin/python3.1
python3.1-dbg: /usr/bin/python3.1-dbg
python3.1-dbg: /usr/bin/python3.1-dbg-config
python3.1-dbg: /usr/lib/debug/usr/bin/python3.1
python3.1-dbg: /usr/lib/debug/usr/bin/python3.1-dbg-gdb.py
python3.1-dbg: /usr/lib/debug/usr/bin/python3.1-gdb.py
python3.1-dev: /usr/bin/python3.1-config
python3.1-minimal: /usr/bin/python3.1
Run Code Online (Sandbox Code Playgroud)