-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommand-not-found.mw
More file actions
78 lines (58 loc) · 3.02 KB
/
Command-not-found.mw
File metadata and controls
78 lines (58 loc) · 3.02 KB
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
73
74
75
76
77
78
{{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 <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 matters <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=
{{IconSet|h1|1}} {{sysmaint_notice}}
{{IconSet|h1|2}} Delete file <code>/etc/apt/apt.conf.d/30usability-misc</code>. <ref>
Delete {{Github_link|
https://github.com/Kicksecure/usability-misc/blob/master/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 <code>command-not-found</code>.
<pre>
Acquire::IndexTargets::deb::Contents-deb::DefaultEnabled false;
</pre>
This 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 Debian bug #857090]
</ref>
{{CodeSelect|code=
sudo safe-rm -f -- /etc/apt/apt.conf.d/30usability-misc
}}
{{IconSet|h1|3}} Install <code>command-not-found</code>.
{{Install Package|
package=command-not-found
}}
{{IconSet|h1|4}} Update the <code>command-not-found</code> database.
{{CodeSelect|code=
sudo update-command-not-found
}}
{{IconSet|h1|5}} Done.
The setup of <code>command-not-found</code> has been completed.
}}
= Issues =
== Local variable 'cnf' referenced before assignment ==
* <u>Debian bug report:</u> [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917455 Debian bug #917455]
* <u>Debian merge request:</u> [https://salsa.debian.org/jak/command-not-found/-/merge_requests/1 Debian Salsa merge request !1]
= See Also =
* <u>Related tool:</u> [[apt-file|<code>apt-file</code>]]
* <u>Forum discussion:</u> [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']
* <u>Forum discussion:</u> [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}}