通常我知道我需要的命令行程序的名称,但我不知道提供该程序的软件包的名称。 如何find包含我需要的程序的包的名称? 在基于RPM的系统上,他们有whatprovides选项rpm -q --whatprovides /usr/X11R6/bin/xclock将会find正确的软件包。 基于Debian的系统有没有类似的东西?
如果安装了软件包,则需要dpkg -S /path/to/file 。 如果软件包未安装,请使用apt-file实用程序( apt-file update; apt-file search /path/to/file )。
Ubuntu有一个命令未find的实用程序,它会告诉你要安装哪个软件包来获取特定的命令。 如果configuration正确(可能在默认安装?),它会显示当您input一个未安装的命令。 但是,您也可以手动运行它:
$ /usr/lib/command-not-found --ignore-installed test The program 'test' is currently not installed. You can install it by typing: sudo apt-get install coreutils
Ubuntu和Debian一样,都带有apt-file应用程序。 这允许你和apt-get非常相似,只是search包中的文件。
因此,你会有的
$ apt-file update $ apt-file search xclock
你去了。 如果幸运的话,您也可以使用Debian软件包网站底部的界面。 如果Ubuntu维护者与原始的Debian版本相比没有太大的改变,这将会起作用。
您也可以使用apt-cache search [file]来检查应用程序的本地caching。