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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.