Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1315  / 1 Year ago, thu, february 2, 2023, 9:43:35

I've enabled apt-get in SUDO without password , and bash autocompletion for it need to be enabled as well , but how ?



If i try to source that file:
%> . /etc/bash_completion.d/apt
No command 'have' found, did you mean:
Command 'vave' from package 'lipsia' (universe)
Command 'havp' from package 'havp' (universe)
Command 'haxe' from package 'haxe' (universe)
Command 'dave' from package 'libhttp-dav-perl' (universe)
Command 'save' from package 'atfs' (universe)
have: command not found
No command 'have' found, did you mean:
Command 'vave' from package 'lipsia' (universe)
Command 'havp' from package 'havp' (universe)
Command 'haxe' from package 'haxe' (universe)
Command 'dave' from package 'libhttp-dav-perl' (universe)
Command 'save' from package 'atfs' (universe)
have: command not found

More From » apt

 Answers
5

The function have() is defined in /etc/bash_completion, so it is not possible to execute /etc/bash_completion.d/apt in isolation.



I think you would need to run the command



. /etc/bash_completion


and it will then execute all the completion scripts in the /etc/bash_completion.d directory.



However, I'm not sure why you would need to do this anyway. On my systems (natty and oneiric) completion for apt-get already works with or without sudo.


[#43372] Friday, February 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arkcker

Total Points: 296
Total Questions: 111
Total Answers: 104

Location: Nepal
Member since Tue, Sep 8, 2020
4 Years ago
arkcker questions
Tue, Aug 17, 21, 00:08, 3 Years ago
Sun, May 14, 23, 01:04, 1 Year ago
Wed, Nov 16, 22, 03:12, 1 Year ago
Tue, Jun 1, 21, 01:29, 3 Years ago
;