Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt autocomplete not working, displaying folders #5949

Closed
mitap94 opened this issue Mar 10, 2017 · 11 comments
Closed

apt autocomplete not working, displaying folders #5949

mitap94 opened this issue Mar 10, 2017 · 11 comments
Labels
Support Request for support Topic: completion Pull Request or issue regarding completion

Comments

@mitap94
Copy link

mitap94 commented Mar 10, 2017

Using Ubuntu 14.04 and apt autocomplete doesn't work.

sudo apt upd...
sudo apt upg...
sudo apt install ter...
None of these commands return anything when I press tab.

If I for example type:
sudo apt install tem and press tab it will resolve to:
sudo apt install Templates/ if I am currently in the home folder. So it is behaving as if I am using cd or something like that.

The apt-get command works normally, and both commands work like they should in bash.

@DevJac
Copy link

DevJac commented Mar 13, 2017

This sounds like an issue I'm having. I have a git alias called git graph and I will type git gra and then hit tab (which would normally autocomplete the alias), and what happens instead is that one of my Python scripts runs. Fortunately it didn't run one of the scripts that launches nukes.

@mitap94
Copy link
Author

mitap94 commented Mar 26, 2017

I should add that everything works great on Linux Mint Cinnamon 18.1

@zephirefaith
Copy link

Same here. Ubuntu 14.04 + oh-my-zsh messes up apt autocomplete. Shows files inside the folder instead. Did not notice this happening in Ubuntu 16.04, if that helps.

@cadebrown
Copy link

I am having this issue as well, anybody have any fixes?

@Freedzone
Copy link

Freedzone commented Nov 4, 2017

Ubuntu 14.04 + oh-my-zsh + SSH - same problem. Instead of apt <command> i am getting list of folders and files

@dermalikmann
Copy link

apt completion does not work on Ubuntu 17.10 either.

@mcornella
Copy link
Member

Can you verify if it works after upgrading with upgrade_oh_my_zsh? Perhaps you have some kind of permission problem with completion folders. If that doesn't do it, please post your zsh --version and what plugins you're using.

@mitap94
Copy link
Author

mitap94 commented Jun 12, 2018

Sorry, I'm not using Ubuntu 14.04 anymore on any PCs.

@Freedzone
Copy link

Freedzone commented Jun 13, 2018

Not working for me, sorry.
zsh 5.0.2 (x86_64-pc-linux-gnu)
plugins=(git zsh-completions)

DITRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

@mcornella
Copy link
Member

If this is still happening, run echo $_comps[apt] and which $_comps[apt] and post the output.

@mcornella mcornella added Topic: completion Pull Request or issue regarding completion Support Request for support labels Apr 8, 2019
@rubenanapu
Copy link

How I solved it

I had auto completion problems trying to autocomplete wget with apt-get install wg[TAB][TAB] and I managed to solve it by removing the --no-generate parameter from the flies below:

/usr/share/bash-completion/completions/apt-cache
/usr/share/bash-completion/completions/apt-get

It is worth mentioning that these files are available only after you install bash-completion.

The --no-generate parameter I'm referring to can be seen in the line below, but I removed ALL --no-generate, not only from this line:
https://github.com/scop/bash-completion/blob/master/completions/apt-get#L28

How did I come to this point?

I got to this point after running set -v previous to apt-get install wg[TAB][TAB], which showed that the command executed was:

apt-cache --no-generate pkgnames wg

and the output was an error:

E: Could not open file  - open (2: No such file or directory)

When I executed apt-cache pkgnames wg without the --no-generate I correctly got the list for autocompletion:

root@484f5c8f56ba:/# apt-cache pkgnames wg
wgalician-minimos
wget2
wgaelic
wget
wgerman-medical
wget2-dev

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Request for support Topic: completion Pull Request or issue regarding completion
Projects
None yet
Development

No branches or pull requests

9 participants