I am using a minimal Debian system which does not have the top program installed. I tried to install top with sudo apt-get install top, but top is not a package name.It seems that top is a part of some other package. How can I find out which package I should install to get it? More generally, how can I find the package that contains a program?
How can I find the package that contains a program in Debian?
debian;apt;package management
The direct answer is procps. Here is how you can find this out for yourself:# Install apt-file, which allows you to search# for the package containing a filesudo apt-get install apt-file# Update the package/file mapping databasesudo apt-file update# Search for top at the end of a pathapt-file search --regexp '/top$'The output of the final command should look something like this:crossfire-maps: /usr/share/games/crossfire/maps/santo_dominion/magara/well/topcrossfire-maps-small: /usr/share/games/crossfire/maps/santo_dominion/magara/well/topliece: /usr/share/emacs/site-lisp/liece/styles/toplxpanel: /usr/share/lxpanel/profile/two_panels/panels/topprocps: /usr/bin/topquilt: /usr/share/quilt/topYou can see that only procps provides an executable in your standard PATH, which gives a clue that it might be the right one. You can also find out more about procps to make sure like it seems like the right one:$ apt-cache show procpsPackage: procpsVersion: 1:3.3.3-3[...]Description-en: /proc file system utilities This package provides command line and full screen utilities for browsing procfs, a pseudo file system dynamically generated by the kernel to provide information about the status of entries in its process table (such as whether the process is running, stopped, or a zombie). . It contains free, kill, pkill, pgrep, pmap, ps, pwdx, skill, slabtop, snice, sysctl, tload, top, uptime, vmstat, w, and watch.