-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommand-not-found.mw
72 lines (54 loc) · 2.72 KB
/
Command-not-found.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{{Header}}
{{Title|
title=command-not-found - suggest installation of missing software packages in terminal
}}
{{#seo:
|description=HowTo: install command-not-found
|image=Notfound14123523.png
}}
[[File:Notfound14123523.png|thumb|250px]]
{{intro|
HowTo: install command-not-found
}}
= Introduction =
Quote Debian package [https://packages.debian.org/{{Stable project version based on Debian codename}}/command-not-found <code>command-not-found</code>]:
<blockquote>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.</blockquote>
= Installation =
The order in which these commands are run matter, <ref>
Also <code>apt update</code> cannot be skipped since package contents files need to be downloaded.
</ref> but the process is idempotent. This means it is possible to re-apply all of the following steps.
{{Box|text=
'''1.''' Delete [https://github.com/{{project_name_short}}/usability-misc/blob/master/etc/apt/apt.conf.d/30usability-misc <code>/etc/apt/apt.conf.d/30usability-misc</code>] 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 <code>command-not-found</code>. <ref>
<pre>
Acquire::IndexTargets::deb::Contents-deb::DefaultEnabled false;
</pre>
breaks <code>command-not-found</code> because it requires <code>/var/lib/apt/lists/*Contents*</code> to exist.
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857090
</ref>
{{CodeSelect|code=
sudo rm -f /etc/apt/apt.conf.d/30usability-misc
}}
'''2.''' Install <code>command-not-found</code>.
{{Install Package|
package=command-not-found
}}
'''3.''' Run <code>update-command-not-found</code> with root rights.
{{CodeSelect|code=
sudo update-command-not-found
}}
'''4.''' Done.
Setup of <code>update-command-not-found</code> has been completed.
}}
= Issues =
== local variable 'cnf' referenced before assignment ==
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917455
* https://salsa.debian.org/jak/command-not-found/-/merge_requests/1
= See Also =
* [[apt-file|<code>apt-file</code>]]
* [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']
* [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}}