{{Header}} {{Title| title=command-not-found - suggest installation of missing software packages in the terminal }} {{#seo: |description=HowTo: install command-not-found |image=Notfound14123523.png }} [[File:Notfound14123523.png|thumb|250px]] {{intro| HowTo: install command-not-found }} = Introduction = From the Debian package description [https://packages.debian.org/{{Stable project version based on Debian codename}}/command-not-found command-not-found]:
Suggest installation of packages in interactive bash sessions This package will install a handler for command_not_found that looks up programs not currently installed but available from the repositories.
= Installation = The order in which these commands are run matters Also apt update cannot be skipped since package contents files need to be downloaded. but the process is idempotent. This means it is possible to re-apply all of the following steps. {{Box|text= {{IconSet|h1|1}} {{sysmaint_notice}} {{IconSet|h1|2}} Delete file /etc/apt/apt.conf.d/30usability-misc. Delete {{Github_link|repo=usability-misc|path=/blob/master/etc/apt/apt.conf.d/30usability-misc|text=/etc/apt/apt.conf.d/30usability-misc}} because it contains settings that [https://forums.whonix.org/t/speeding-up-apt-update-with-acquire-languages-none-and-contents-deb-defaultenabled-false-its-so-much-faster/8894 speed up APT] but break command-not-found.
Acquire::IndexTargets::deb::Contents-deb::DefaultEnabled false;
This breaks command-not-found because it requires /var/lib/apt/lists/*Contents* to exist. See: [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857090 Debian bug #857090]
{{CodeSelect|code= sudo safe-rm -f -- /etc/apt/apt.conf.d/30usability-misc }} {{IconSet|h1|3}} Install command-not-found. {{Install Package| package=command-not-found }} {{IconSet|h1|4}} Update the command-not-found database. {{CodeSelect|code= sudo update-command-not-found }} {{IconSet|h1|5}} Done. The setup of command-not-found has been completed. }} = Issues = == Local variable 'cnf' referenced before assignment == * Debian bug report: [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917455 Debian bug #917455] * Debian merge request: [https://salsa.debian.org/jak/command-not-found/-/merge_requests/1 Debian Salsa merge request !1] = See Also = * Related tool: [[apt-file|apt-file]] * Forum discussion: [https://forums.whonix.org/t/command-not-found-warningcould-not-open-file-etc-apt-sources-list/7903 command-not-found - WARNING:root:could not open file '/etc/apt/sources.list'] * Forum discussion: [https://forums.whonix.org/t/speeding-up-apt-update-with-acquire-languages-none-and-contents-deb-defaultenabled-false-its-so-much-faster/8894 Speeding up "apt update" with Acquire::Languages=none and Contents-deb::DefaultEnabled=false - It's so much faster!] = Footnotes = {{reflist|close=1}} [[Category:Documentation]] {{Footer}}