Ubuntu 11.04 and broken bash completion
by Tim on 2011-05-10, under Technology
Ubuntu 11.04, aka Natty Narwhal, was released on April 28th and so naturally I chose to break my perfectly functioning laptop to see what was new. That “upgrade” button really needs to read something like, “download and install new software then spend a week scouring the internet for information and trying to fix all the shit that just broke.” But that’s probably a little too verbose for the UX people.
What broke?
To be completely fair, most things did not break. It was mainly KDE (my default X session), that new Unity business, “classic” Gnome (not entirely broken, but severely wounded), and bash shell tab completion. Or, in other words, just a number of the most important parts for actually “using” my computer to “do things.” I apologize for blowing things out of proportion.
I’ve gotten KDE (and Gnome, but not Unity — it refuses to believe my hardware is sufficient to run it) back up and running now after deleting tons of old configuration files (.kde*, .gconf, selectively under .config…and a bunch of other stuff I’ve forgotten) and also by accepting that the combination of Compiz + KDE is no longer usable and switching out Compiz for KDE’s native window manager, KWin. I had originally ditched KWin because it didn’t play nice (broken desktop effects and resource hogging and slow and crash-y) with fglrx (the radeon graphics driver.) KWin runs with direct rendering and GLSL shaders disabled (on my ATI Mobility Radeon HD 3650) and it’s (mostly) not as good as Compiz + KDE used to be. But it is 90% as good and the best and only real current option.
About that bash completion…
And then there was the broken bash completion (<tab>-completion.) For example, typing “ls /et<tab>” yielded “ls /etc ” and not “ls /etc/” (note the extra space and lack of closing slash at the end.) Reinstalling bash-completion did not fix this problem for me. What did work was removing bash-completion, renaming /etc/bash_completion.d/ → /etc/bash_completion.d.bak/, and then reinstalling bash-completion.
user@machine:~$sudo apt-get purge bash-completion
user@machine:~$sudo mv /etc/bash_completion.d /etc/bash_completion.d.bak
user@machine:~$sudo apt-get install bash-completion
After reinstalling bash-completion, /etc/bash_completion.d/ reappeared. I diffed the two directories and the new one had way more stuff so I just rm -rfed the old one. I’m happy to say my bash completion is working again and I’m going to file this problem under ‘s.’ For “solved.”
Conclusion
Well, that was fun! Looking forward to willingly breaking my computer again in another 6 months! See you then!
6 Comments for this entry
1 Trackback or Pingback for this entry
-
Fix the broken Bash file and directory name completion on Ubuntu Linux | zandyware
June 2nd, 2012 on 5:13 pm[...] append the backslash nor printed out candidates (just like what it described like here and here). It drove me banana. Meanwhile, my Bash worked very well under other Linux distributions [...]
May 23rd, 2011 on 6:52 pm
Funny, after installing 11.04 I thought the bash completion change was somehow meant to be a “feature”. I’m pleased it was a bug – otherwise I would have had serious worries about where Ubuntu was going.
There is now an even simpler solution someone has provided in a bug report for this: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/769866/comments/10
Basically it involves changing one word in /etc/bash_completion.
May 23rd, 2011 on 10:19 pm
If all that was actually wrong with the bash-completion upgrade was that ‘filenames’ was incorrectly replaced by ‘default’ in the new bash_completion script then that fix is the right one. But I think there was more wrong with the upgrade than just that single command option. Just my intuition/best guess.
I was blissfully unaware of the specifics behind bash completion until I was bitten by this bug. And I really should have done a better job of trying to figure out exactly what was broken in the upgrade process but I just wanted to “make it work now, dammit!” I suppose next time something like this happens I’ll consider the possibility that the bug is affecting other people and go about diagnosing and fixing it in a more measured way.
September 6th, 2011 on 9:37 am
Thanks Tim, for posting your fix, worked great. This was driving me bonkers.
Now I just need to fix middle-button paste… Until I find the next thing they broke. I so regret moving to Ubuntu 11….
September 28th, 2011 on 4:15 pm
Thank you Tim, you are a great man.
This issue was driving me insane. Funny how the little things tend to do that.
11.04 is edgy (no pun intended) at some points, and this certainly was one of them.
April 9th, 2012 on 6:42 pm
Thank you so much for posting this. I just came across this issue a few days ago and your directions fixed it.
December 23rd, 2012 on 8:22 am
Thanks for the post. Saved me a week of scouring the internet. All hail Google!