apt-get Bash Autocompletion Not Working

Bug #368361 reported by Sb
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

Hi,

I installed Ubuntu Jaunty from the alternate CD with the "command line system" install option. Unlike previous versions, "apt-get install <TAB> no longer autocompletes package names. "apt-get remove" does autocomplete still. This is quite a significant regression. I have verified that the bash-completion package is installed.

Thanks.

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

* Is this reproducible?
* If so, what specific steps should we take to recreate this bug?

This will help us to find and resolve the problem.

By the way, the auto-completion for the apt-get command works fine for me. If it's on a fresh install, perhap's this completion needed an "apt-get update" before.

Changed in bash-completion (Ubuntu):
status: New → Incomplete
Revision history for this message
Sb (sb56637) wrote : Re: [Bug 368361] Re: apt-get Bash Autocompletion Not Working

Hi,
> * Is this reproducible?
>
Yes every time, "apt-get install gnome<TAB>" should return many many
suggestions, and it never does.

> * If so, what specific steps should we take to recreate this bug?
>
Try to autocomplete anything with apt-get.

> me. If it's on a fresh install, perhap's this completion needed an "apt-
> get update" before.
>
It's already updated, I've been using Synaptic without any problems.

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

Some more things you can confirm

- have you the auto-completion activated in your ~/.bashrc file ?
- have you rebooted your computer since you constated this bug?
- can you join your /etc/bash_completion file ?
- can you try to re-install the bash-completion and the apt packages and see if you have the same issue?

Tank's.

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 02:29 PM, YoBoY wrote:
> Some more things you can confirm
>
> - have you the auto-completion activated in your ~/.bashrc file ?
>
Could you please send me your ~/.bashrc file if it works correctly? I
don't understand the script language very well. I'm attaching mine.

> - have you rebooted your computer since you constated this bug?
>
Yes. It's worth mentioning that this happened on both of my installs,
both Kubuntu and Ubuntu, both using the "Alternate" CD with the F4
"Command line system" option.

> - can you join your /etc/bash_completion file ?
>
Attaching

> - can you try to re-install the bash-completion and the apt packages and see if you have the same issue?
>
I already re-installed bash-completion. I'm not sure which apt package
to re-install.

Thanks!

Revision history for this message
James Westby (james-w) wrote :

On Wed, 2009-04-29 at 18:23 +0000, Sb wrote:
> Hi,
> > * Is this reproducible?
> >
> Yes every time, "apt-get install gnome<TAB>" should return many many
> suggestions, and it never does.

Are you a user when you try this, or root? If root, are you using "sudo
apt-get", or in a "sudo -i" session?

Thanks,

James

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 03:02 PM, James Westby wrote:
> On Wed, 2009-04-29 at 18:23 +0000, Sb wrote:
>
>> Hi,
>>
>>> * Is this reproducible?
>>>
>>>
>> Yes every time, "apt-get install gnome<TAB>" should return many many
>> suggestions, and it never does.
>>
>
> Are you a user when you try this, or root? If root, are you using "sudo
> apt-get", or in a "sudo -i" session?
>
> Thanks,
>
> James
>
>
;-) Sorry, it's not that simple. I always use sudo, just forgot to
mention it.

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

With or without the sudo it's working for me. The "apt" package it's the "apt" package, only one have this name ;-)

can you try a "apt-cache pkgname gnome-" without the sudo and tell us if you have a result?

Tanks

Revision history for this message
James Westby (james-w) wrote :

On Wed, 2009-04-29 at 20:11 +0000, Sb wrote:
> On 04/29/2009 03:02 PM, James Westby wrote:
> > On Wed, 2009-04-29 at 18:23 +0000, Sb wrote:
> >
> >> Hi,
> >>
> >>> * Is this reproducible?
> >>>
> >>>
> >> Yes every time, "apt-get install gnome<TAB>" should return many many
> >> suggestions, and it never does.
> >>
> >
> > Are you a user when you try this, or root? If root, are you using "sudo
> > apt-get", or in a "sudo -i" session?
> >
> > Thanks,
> >
> > James
> >
> >
> ;-) Sorry, it's not that simple. I always use sudo, just forgot to
> mention it.

So "sudo apt-get install gnome<TAB>" is what you are doing?

What is the output of

  echo $BASH_COMPLETION
  echo $BASH_COMPLETION_DIR

?

Thanks,

James

Revision history for this message
Sb (sb56637) wrote :

>
> can you try a "apt-cache pkgname gnome-" without the sudo and tell us if
> you have a result?
>
  Without the sudo it says "E: Opening configuration file
/etc/apt/apt.conf - ifstream::ifstream (13 Permission denied)"

With sudo it returns...
=====
gnome-keyring
gnome-swallow
gnome-do
gnome-tasksel
gnome-sharp2-examples
...
=====
...and many more.

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 03:29 PM, James Westby wrote:
> So "sudo apt-get install gnome<TAB>" is what you are doing?
>
Yes

> What is the output of
>
> echo $BASH_COMPLETION
>
/etc/bash_completion

> echo $BASH_COMPLETION_DIR
>
/etc/bash_completion.d

And I imagine you might want to know the following:
username@host:~$ ls /etc/bash_completion.d/
debconf deborphan desktop-file-validate ooffice.sh pon

Revision history for this message
James Westby (james-w) wrote :

On Wed, 2009-04-29 at 20:37 +0000, Sb wrote:
> >
> > can you try a "apt-cache pkgname gnome-" without the sudo and tell us if
> > you have a result?
> >
> Without the sudo it says "E: Opening configuration file
> /etc/apt/apt.conf - ifstream::ifstream (13 Permission denied)"

That's the issue then.

If you make this file world-readable (after checking there is nothing
sensitive in there) then it should work.

Thanks,

James

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

Well finaly we are aproching the answer :-)

The apt-cache can't access to the list of packages because your user don't have enought rights to do this.

I don't know why this appening.

Need more experienced triager for this, but it's not a bash-completion problem.

I'm going asking for more help.

Tanks

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 04:01 PM, James Westby wrote:
> On Wed, 2009-04-29 at 20:37 +0000, Sb wrote:
>
>>> can you try a "apt-cache pkgname gnome-" without the sudo and tell us if
>>> you have a result?
>>>
>>>
>> Without the sudo it says "E: Opening configuration file
>> /etc/apt/apt.conf - ifstream::ifstream (13 Permission denied)"
>>
>
> That's the issue then.
>
> If you make this file world-readable (after checking there is nothing
> sensitive in there) then it should work.
>
> Thanks,
>
> James
>
>

Sure enough, I did a "sudo chmod 777 /etc/apt/apt.conf" and it works.
So it would appear that a deb package or a post-install script in the
alternate install CD is wrongly setting the permissions on that file.

Thanks a lot!

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

By the way (sorry for the double post) have you tried to reinstall the "apt" package ?

can you join the /etc/apt/apt.conf file (if this file exist) and say us the read/write privilèges for this file ? Give us also the rights of the /etc/apt/apt.conf.d directory (a "ls -l /etc/apt/ " for exemple)

Tanks

Revision history for this message
YoBoY (yoboy-leguesh) wrote :

This bug report is being closed due to your last comment regarding this being fixed with your change of the rights on the /etc/apt/apt.conf file. This file is normaly not provided by the packages of ubuntu. If you don't have personnaly created this file, could you report this issue on the ubiquity or the apt package ?
Thank you again for taking the time to report this bug and helping to make Ubuntu better. Please submit any future bugs you may find.

Changed in bash-completion (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
James Westby (james-w) wrote :

On Wed, 2009-04-29 at 21:15 +0000, YoBoY wrote:
> By the way (sorry for the double post) have you tried to reinstall the
> "apt" package ?
>
> can you join the /etc/apt/apt.conf file (if this file exist) and say us
> the read/write privilèges for this file ? Give us also the rights of the
> /etc/apt/apt.conf.d directory (a "ls -l /etc/apt/ " for exemple)

dpkg -S /etc/apt/apt.conf

will tell you if dpkg knows about this file.

Also, attaching that file to this report would give us a clue where this
file came from.

I agree with closing the bug, but finding out where it came from might
be interesting :-)

Thanks,

James

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 04:15 PM, YoBoY wrote:
> By the way (sorry for the double post) have you tried to reinstall the
> "apt" package ?
>
> can you join the /etc/apt/apt.conf file (if this file exist) and say us
> the read/write privilèges for this file ? Give us also the rights of the
> /etc/apt/apt.conf.d directory (a "ls -l /etc/apt/ " for exemple)
>
> Tanks
>
Attaching /etc/apt/apt.conf Please note that this file did not exist,
but I added it to prevent installation of recommended packages. I have
not tried reinstalling the "apt" package.

Here is "ls -l /etc/apt":
=====================
username@host:~$ ls -l /etc/apt/
total 36
-rwxrwxrwx 1 root root 33 2009-04-27 12:27 apt.conf
drwxr-xr-x 2 root root 4096 2009-04-27 13:18 apt.conf.d
-rw------- 1 root root 0 2009-04-27 12:14 secring.gpg
-rw-r--r-- 1 root root 3351 2009-04-28 08:16 sources.list
-rw-r--r-- 1 root root 3256 2009-04-28 08:15 sources.list~
drwxr-xr-x 2 root root 6 2009-04-16 23:27 sources.list.d
-rw------- 1 root root 1200 2009-04-27 12:14 trustdb.gpg
-rw-r--r-- 1 root root 6713 2009-04-27 12:14 trusted.gpg
-rw-r--r-- 1 root root 6713 2009-04-27 12:14 trusted.gpg~
=====================

Thanks!

Revision history for this message
Sb (sb56637) wrote :

On 04/29/2009 06:16 PM, James Westby wrote:
> Also, attaching that file to this report would give us a clue where this
> file came from.
>
> I agree with closing the bug, but finding out where it came from might
> be interesting :-)
>

Ah, I just now realized that I was the one who created that file from
the very beginning (per instructions on the release notes
http://www.ubuntu.com/getubuntu/releasenotes/904 ) because I don't want
recommended packages to be automatically installed.

So, sort of my fault, but the release notes should give better instructions.

Thanks for the help with this.

Revision history for this message
Cristian Arezzini (macavity80) wrote :

I have the same problem of the original poster (no autocompletion with sudo apt-get install), but I do not have the /etc/apt/apt.conf file. This is a standard install of Ubuntu Jaunty from the regular desktop CD.
I tried the command "apt-cache pkgname gnome-" without the sudo, as suggested above, but I get a "E: Invalid operation pkgname" error. I have to use "pkgnames" with the "s" to make it work, and then it gives me the list of packages even without the sudo. Could this be the problem? Is there any way to fix it?

Revision history for this message
golroch (golroch) wrote :

Have the same problem as Cristian Arezzni.Using Hard Heron 64 bit, oddly enough my Hard Heron 32 bit works. I tried to compare my bash_completion files and they look the same. So I can't understand how it is a bug on one system. I have tried to reinstall bash_completion but to no avail.

Revision history for this message
golroch (golroch) wrote :

Sorry but removing bash_completion and logging back into the system fixed the issue. Thanks

Changed in bash-completion (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
yacine chaouche (yacinechaouche) wrote :

Hello,

I have the same problem but for apt-get remove autocompletion on "Lucid".

When I type :

root@jogger:~# sudo apt-get remove linux<tab>

I get :

root@jogger:~# sudo apt-get remove linux^[\[m^[\[K^[\[m^[\[K-

I didn't encounter this bug in any circumstance other than the apt-get remove command.

Revision history for this message
Ken Sharp (kennybobs) wrote :

Fixed in Precise

Changed in bash-completion (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.