How do I stop my bash shell from asking to install a package?

4

When I mis-type a command, the shell tries to find a package that provides it. How do I disable this feature?

Example:

[dave@dave cpp]$ sl
bash: sl: command not found...
Install package 'sl' to provide command 'sl'? [N/y] 

I'd like if if I weren't prompted to install the command.

Dave

Posted 2013-09-05T12:56:19.093

Reputation: 687

Wow, that seems annoying beyond reason! I know Ubuntu uses similar package suggestion, but at least it doesn't end in a prompt. Is this standard in Fedora Desktop? I run Fedora on a server and do not recognize it. – Daniel Andersson – 2013-09-05T15:04:52.357

Answers

10

The problem is PackageKitCommandNotFound. Removing it

yum remove PackageKit-command-not-found

should do the trick, according to the mailing list.

John Bensin

Posted 2013-09-05T12:56:19.093

Reputation: 1 355

2

After doing a

yum remove PackageKit-command-not-found

if you get the error,

bash: /usr/libexec/pk-command-not-found: No such file or directory

you will need to add the follow line to ~/.bashrc

unset command_not_found_handle

johnP

Posted 2013-09-05T12:56:19.093

Reputation: 71

Or log out and back in again. It's worth noting that unsetting command_not_found_handle is sufficient even without removing the package. – mattdm – 2016-04-19T21:31:14.187

@mattdm it's not sufficient, still need to remove that package. – DominiCane – 2019-07-25T10:58:39.943