Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've recently installed Fedora 19. Packagekit-command-not-found is installed. But its own examples don't work. When I enter gedti the output is:

bash: gedti: command not found... Similar command is: 'gedit'

And it works correctly but when I enter powertop, the output is:

bash: powertop: command not found...

With no suggestion about the package. Why? Should I edit some configuration files or update some cache or ... ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

There is definitely some weirdness with PackageKit. I already had powertop installed but wanted to test out what you're having issues with.

$ rpm -ql PackageKit-command-not-found
/etc/PackageKit/CommandNotFound.conf
/etc/profile.d/PackageKit.sh
/usr/libexec/pk-command-not-found

So from the above you can run the command that PackageKit will run to do the search like so:

$ /usr/libexec/pk-command-not-found <command>

Example

$ /usr/libexec/pk-command-not-found powertop
bash: powertop: command not found...

$ which powertop
/usr/bin/powertop

Running it a 2nd time I got it to recommend powertop:

$ /usr/libexec/pk-command-not-found powertop
bash: powertop: command not found...
Install package 'powertop' to provide command 'powertop'? [N/y] 

So why isn't it finding powertop?

I think that ultimately the root cause is the timeout that's defined in the config file: /etc/PackageKit/CommandNotFound.conf:

MaxSearchTime=2000

This timeout is to cap how long PackageKit will take to do it's query. The query is not against your local Yum cache, it's searching live against Yum repositories that you have configured on the internet. Therefore if you want it to be more thorough vs. more performant you have the following trade-off:

# aggressive find
MaxSearchTime=15000

# more responsive
MaxSearchTime=250    
share|improve this answer
    
I did the same but didn't get the recommendation. –  Farzam Jul 12 '13 at 20:58
    
@Farzam What's your timeout set to in the CommandNotFound.conf file? –  slm Jul 12 '13 at 20:59
    
I've set it to 15000, 150000, 1500000, ... but didn't work. Does it connect to internet? Can I add -C flag to its search command? –  Farzam Jul 12 '13 at 21:07
    
@Farzam - it uses a different mechanism that the completion. –  slm Jul 12 '13 at 21:12
    
so what should I do? It also doesn't work when I'm disconnected from the internet. –  Farzam Jul 12 '13 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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