8

I use Fedora 23. In an older version of Fedora (or maybe it was Ubuntu), I used to get package suggestions at the command line (Bash) when a command wasn't found. I liked this.

$ glmark2
Command not found
Command glmark2 is provided by package glmark2. 
Would you like to install it? (y/n)
Installed package glmark2.

How can I get this feature in Fedora 23?

4
  • as far as I can tell it works in current Fedora by default (at least Workstation).
    – Jakuje
    Dec 13, 2015 at 22:27
  • Cool. I'm running the MATE spin of Fedora 23. Maybe I'm missing a package. Dec 13, 2015 at 22:28
  • Normally i will type n to quit and then manually install via dnf, the reason is because there's no download progress/sizes
    – 林果皞
    Jan 2, 2016 at 15:08

1 Answer 1

10

The package on Fedora is called PackageKit-command-not-found.

The Fedora package installs a hook in /etc/profile, so it's only available in login shells. To make it available in all interactive instanced of bash, add the following lines to your ~/.bashrc:

if [ -e /etc/profile.d/PackageKit.sh ]; then
  . /etc/profile.d/PackageKit.sh
fi
7
  • It isn't in pkgdb because pkgdb is indexed by source RPMs, and this one is built as a subpackage of the main PackageKit source RPM.
    – mattdm
    Dec 14, 2015 at 13:27
  • @mattdm Ah, thanks. Is there a way to look up binary packages on pkgdb or a similar site? I guess there's always rpmfind, but that requires pinpointing a version and architecture. Dec 14, 2015 at 14:56
  • Yeah — you can search for it in Fedora Packages Search, which is a different application meant to be more end-user-useful. (pkgdb is really a packager-centric view.)
    – mattdm
    Dec 14, 2015 at 14:59
  • 1
    I'll have to check. I found it by searching for the full string PackageKit-command-not-found
    – mattdm
    Dec 14, 2015 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .