When type a nonexistent command, bash show "command not found...". In ubuntu, it will give advice for which package need to be installed; In Fedora, nothing show.

So which software has this function in Fedora? I think it's not in *bash-completion.

PackageKit-command-not-found suggest by Stephen Kitt: output


In Fedora, this functionality is provided by the PackageKit-command-not-found package. It adds a /etc/profile.d/PackageKit.sh startup script which sets up command-not-found handling. With this in place, I get for example

$ evolution
bash: evolution: command not found...
Install package 'evolution' to provide command 'evolution'? [N/y]

It only works if DBus is running and if packagekitd is installed.

  • ▶ pgrep -l package 3316 /usr/libexec/packagekitd
    – eexpress
    Mar 28 '17 at 8:11
  • I found it works depend on network, not search local cache.
    – eexpress
    Mar 28 '17 at 9:07

Use this command:

yum whatprovides '*foo'

where foo is the command you typed and is missing on your machine.

The reason for the wildcard is that yum whatprovides takes as argument an absolute file path.

  • I know this, I use "dnf provides". but it's manually.
    – eexpress
    Mar 28 '17 at 7:02
  • 1
    The question is not worded very well, but it's asking how Ubuntu accomplishes it, not how to mimic it.
    – jamesdlin
    Mar 28 '17 at 10:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.