2

When the package command-not-found is installed, a package is suggested if a command is invoked which is not installed, for instance

$ convert
The program 'convert' is currently not installed.  To run 'convert' please ask your administrator to install the package 'imagemagick'
convert: command not found

If command-not-found is not installed, is there an apt command I can invoke to find which package provides a specific binary? In this case the apt-cache search command is too unspecific.

August Karlstrom
  • 1,736
  • 2
  • 27
  • 39
  • 3
    Well there's `apt-file` (e.g. `apt-file search 'bin/gedit'`) - but that's likely not installed by default either. Is `apt-cache search --names-only gedit` specific enough? – steeldriver Jun 21 '17 at 17:23
  • 1
    `apt-file search /usr/bin/convert | grep -w '/usr/bin/convert'` – GAD3R Jun 21 '17 at 17:54
  • @steeldriver It's better, but still you often get a long list of candidates. Also, if the name of the command in question is not a part of the package name it won't work (i changed "gedit" in the example to "convert" to reflect this). – August Karlstrom Jun 21 '17 at 18:16
  • 1
    @GAD3R That seems to work. – August Karlstrom Jun 21 '17 at 18:18
  • 1
    Does this answer your question? [Finding the package which provides a given command](https://unix.stackexchange.com/questions/530413/finding-the-package-which-provides-a-given-command) – aphid Aug 30 '22 at 09:26

0 Answers0