dramatic combination of apt-get and bash completion

Bug #1004225 reported by nesthib
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I don't know what to blame between apt-get, bash completion and myself… I'm reporting this as a bug but it can also be seen as an open question.

I wanted to install a python related package but was missing the exact name when I was about to type it, thus I tried completion to list the names of python packages:

sudo apt-get install python-[tab]

which nicely produces the list of python-* packages
scrolling the list a bit too far (using [enter]) it launched the command:

sudo apt-get install python-

resulting in the removal of python and a few hundreds of other packages depending on python.

I know it's mostly based on a human mistake (I should have thought about the package name before…), but the result is pretty dramatic and I wonder if something could be done to prevent this?

Maybe scrolling in completion shouldn't use [enter] but arrows or [space]

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1004225/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
nesthib (nesthib)
affects: ubuntu → bash-completion (Ubuntu)
Changed in bash-completion (Ubuntu):
status: New → Opinion
Revision history for this message
Peter Cordes (peter-cordes) wrote :

I always scroll pages of completion results with space, not enter. I didn't know enter was an option there. I just tried it, looks like enter goes by lines, instead of pages? No wonder you were holding it down. So... don't do that. esp. not on sudo.

 To easily get a big list that you need to page, do
d[TAB]
There are a lot of commands that start with d, so you will get a nice big list. Or for an even bigger list:
nice [TAB] => all the commands

(the bash option to not tab-complete all the commands on an empty line defaults to on, in Trusty at least, so that's why you need nice or sudo or some other meta-command to trigger it.)

 I don't think there's any point leaving the bug report open, so marking it invalid.

 I hope you were able to ^c your apt-get before much harm was done. There should be logs somewhere in /var/log/apt/history of what got un-installed. In case it's still relevant 2 years on...

Changed in bash-completion (Ubuntu):
status: Opinion → Invalid
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.