Linux Tips: bash completion: /dev/fd/62: No such file or directory
This post will show how to deal with the issue I had on a newly installed debian lenny xen virtual machine. I used xen-tools to create the vm using the deboostrap method, and all was fine. I installed the bash-completion package, as probably most of you, I can’t live without bash completion, but quickly found out that it was broken. Any attempt to perform a filelist completion was failing with this error:
vm11:~# tail -f /va<TAB>-bash: /dev/fd/62: No such file or directory
-bash: /dev/fd/60: No such file or directory
and this basically makes the bash completion useless. On a quick look I could easily see that the /dev/fd link was not there and that was the main cause of the problem. Still on one older lenny vm I had for a couple of months this was not happening (from what I can tell because it had an older version of the /etc/bash_completion file). There are several ways to fix this starting with the obvious one to downgrade /etc/bash_completion but I didn’t like that, so I looked for some other ways.
Manually create the /dev/fd link
This is a quick fix: we create the /dev/fd link manually:
ln -s /proc/self/fd /dev/fd
and bash completion will start working immediately.
Still, after the vm is restarted this link will be lost as /dev is not a persistent storage. We could of course add the link creation command to rc.local, but at this point I asked myself why udev was not creating that file automatically as it was present under /dev/.static/dev/fd?
Udev was missing
Then I realized that udev package was not installed, and this was the reason for the static devices not being created. I manually installed udev using:
aptitude install udev
and this was the solution for my problem. Hopefully you will find this post useful if you have the same problem, and it will save you the trouble to go into looking yourself for a solution for this.
>
Tags: bash, debian-lenny, tips, xen, xen-tools







18th February 2009, 18:09
This happened to me a couple of weeks back; I meant to blog about it, but kept getting sidetracked. Thanks for publicizing.
19th February 2009, 15:10
On a quick look I could easily see that the /dev/fd link was not there and that was the main cause of the problem.
Not the missing ling was the main problem. Broken bashcomp was the main problem. Better fix it than workaroud.
I meant to blog about it, but…
Do not blog, fix the source
19th February 2009, 15:16
@Ash: I never said this is the only solution, nor the best; if you have fixed this in another way (bashcomp) that is great; feel free to share your solution… I’m sure it took you less than writing the comment
22nd February 2009, 21:22
[...] Linux Tips: bash completion: /dev/fd/62: No such file or directory This happened to me. If you manage virtual computers that live on xen servers, it could happen to you. [...]
23rd February 2009, 19:49
Cool, this one saved me diggin’ for myself.
Thanks so much!
27th February 2009, 17:55
Thanksf or the tip!
15th May 2009, 10:27
thanks dude
20th July 2009, 06:03
Yours was the first google hit for the error message and saved me a lot time. Thanks for blogging this
23rd November 2009, 10:57
thanx a lot for that one mate! saved me a lot of time!