Ubuntu 16.04 LTS 上的顶部(进程表)包

use*_*291 16 top 16.04

当我跑步时sudo apt install top,我得到E: Unable to locate package top

我搜索packages.ubuntu.com顶部封装在32位的Ubuntu 16.04 LTS,却是没有。

我想知道它是正确的还是我遗漏了什么。

Ter*_*nce 19

它可能与procps软件包一起安装。它在所有 *NIX 操作系统中也很常见。如果您确实需要找到它的安装内容,请先安装apt-file

sudo apt install apt-file && apt-file update
Run Code Online (Sandbox Code Playgroud)

如果您运行which命令,它将返回安装到的文件夹:

$ which top
/usr/bin/top
Run Code Online (Sandbox Code Playgroud)

然后像这样搜索:

apt-file search --regexp '/top$'
Run Code Online (Sandbox Code Playgroud)

它会返回一个这样的列表:

broctl: /usr/share/broctl/scripts/helpers/top
crossfire-maps: /usr/share/games/crossfire/maps/santo_dominion/magara/well/top
crossfire-maps-small: /usr/share/games/crossfire/maps/santo_dominion/magara/well/top
liece: /usr/share/emacs/site-lisp/liece/styles/top
lubuntu-extra-sessions: /usr/share/lxpanel/profile/Lubuntu-Nexus7/panels/top
lxpanel: /etc/xdg/lxpanel/two_panels/panels/top
procps: /usr/bin/top
quilt: /usr/share/quilt/top
trn4: /usr/share/doc/trn4/examples/univ/top
trn4: /usr/share/trn4/HelpFiles/top
Run Code Online (Sandbox Code Playgroud)

然后你要做的就是匹配文件夹,也就是行首的包。

或者,您可以将语句组合为一个,它应该返回一个更准确的结果:

$ apt-file search --regexp "^$(which top)$"
procps: /usr/bin/top
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助!

  • `apt-get install procps` 是我正在寻找的不太前沿和中心的解决方案。 (5认同)
  • 你可以使用 `dpkg -S /usr/bin/top` 来找出顶级二进制文件所在的安装包。无需安装`apt-file`。 (3认同)
  • @marcelm 如果您愿意,您可以为此写一个答案。您的答案将涵盖查找提供特定文件的已安装包的情况。否则,需要使用 `apt-file` 或 https://packages.ubuntu.com。 (2认同)

edw*_*ksl 12

如果您使用http://packages.ubuntu.com/查找提供 的包,则top需要top在“搜索包的内容”部分进行搜索。这样搜索的结果是:

File                                                            Packages
/etc/xdg/lxpanel/two_panels/panels/top                          lxpanel
/usr/bin/top                                                    procps
/usr/share/broctl/scripts/helpers/top                           broctl
/usr/share/doc/trn4/examples/univ/top                           trn4
/usr/share/emacs/site-lisp/liece/styles/top                     liece
/usr/share/games/crossfire/maps/santo_dominion/magara/well/top  crossfire-maps, crossfire-maps-small
/usr/share/lxpanel/profile/Lubuntu-Nexus7/panels/top            lubuntu-extra-sessions
/usr/share/quilt/top                                            quilt
/usr/share/trn4/HelpFiles/top                                   trn4
Run Code Online (Sandbox Code Playgroud)

在你的情况,你最有可能寻找,提供了包/usr/bin/top,这是procps

不出所料,搜索结果与apt-file@Terrance 的回答中提到的使用发现的结果相同。