今天在64服务器上:发现好像bash 坏了,用户名前边 用-bash 显示,,前几天就发现这个问题,,,但是当时忙没有解决,,,,,今天来看看到底是怎么回事!
File Exists but... "-bash: No such file or directory"
网上找到一篇文章,是说ubuntu系统的,我现在使用的是RHEL6.1 ,先不说其他的,先实践再说,完了看效果!!
-----------------粘贴网上原文---------原文地址:http://superuser.com/questions/344533/no-such-file-or-directory-error-in-bash-but-the-file-exists
On Ubuntu, I get a 'No such file or directory' error when I try to execute a command. I have checked with
|
|||||||||
|
It's an executable file that misses required libraries. Use |
|||||
|
Android SDK requires 32-bit libraries. You probably are on 64-bit and need the 32-bit libs. Here are the troubleshooting directions from developer.android.com For Ubuntu 13.10 (Saucy Salamander) and above, install the
For earlier versions of Ubuntu, install the
|
|||||||||||||||||
|
is also need for me. |
|||||
|
I was also seeing the same after switching my machine from 32 bit ubuntu to 64 bit. Bash would report 'No such file or directory' of files that clearly existed with the execute attribute.
Fixed the problem. These are the "GNU C Library: 32-bit shared libraries for AMD64" Seems like this is a bug in bash. Note that I also changed the default shell from dash to bash using
before I tried running the 32 bit executable. So I'm not sure if the problem would have happened with the default dash shell |
|||
On a fresh Xubuntu 13.10 x64 install I got
And also and if you still miss something use:
|
|||||
|
For adb make sure you have the SDK unpacked and have run the SDK Manager to fully populate the SDK. Additionally make sure you have the following installed: A.) JDK 6 or better B.) lib32stdc++6 C.) lib32ncurses5 hoffmanc was the closest to getting it right, I don't really understand why the answer from Daniel Beck is marked as correct when it's not even close and has nothing to do with the problem. Incidentally, if you try to run a truly non-existant command (i.e.:
you'll get: fakecommand: command not found, whereas in your situation the output you are seeing is actually coming from adb even though it's not very clear that is the case. |
|||
Ubunto seems to have some issues with LSB compatibility, so try this if you are on Ubunto
Note that ldd will sort of show that all the libraries are there, but they are not.
|
|||||
|
----------------- -------------------------------------------------
我的操作步骤!
702 find / | grep rhel6.1 找到yum的安装包目录
703 cd /home/mdsoss/rhel6.1_x64 cd 到该目录
704 ls
705 cd Packages/ -----------------------
706 ls |
707 ls libncurse* |
708 ls *ncurse* |
709 rpm -ivh ncurses-devel-5.7-3.20090208.el6.i686.rpm |
710 rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm |
711 ls -----------------------------无用
712 ls *stdc++*
713 rpm -ivh libstdc++-devel-4.4.5-6.el6.x86_64.rpm
714 rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
715 rpm -ivh libstdc++-4.4.5-6.el6.x86_64.rpm
716 rpm -ivh libstdc++-docs-4.4.5-6.el6.x86_64.rpm 安装所有的相关包
717 rpm -ivh libstdc++-4.4.5-6.el6.i686.rpm
718 rpm -ivh libstdc++-devel-4.4.5-6.el6.i686.rpm
719* ls
720 ls *ncurse*
721 rpm -ivh ncurses-devel-5.7-3.20090208.el6.i686.rpm
722 rpm -ivh ncurses-libs-5.7-3.20090208.el6.i686.rpm
723 rpm -ivh ncurses-libs-5.7-3.20090208.el6.x86_64.rpm
724 rpm -ivh ncurses-term-5.7-3.20090208.el6.x86_64.rpm 安装所有的相关包
725 rpm -ivh ncurses-5.7-3.20090208.el6.x86_64.rpm
726 rpm -ivh ncurses-base-5.7-3.20090208.el6.x86_64.rpm
727 rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm
728 rpm -ivh ncurses-devel-5.7-3.20090208.el6.i686.rpm
729 ls *zlib*
730 rpm -ivh zlib-1.2.3-25.el6.x86_64.rpm
731 rpm -ivh zlib-1.2.3-25.el6.i686.rpm
732 rpm -ivh zlib-devel-1.2.3-25.el6.i686.rpm
733 rpm -ivh zlib-devel-1.2.3-25.el6.x86_64.rpm 安装所有的相关包
734 rpm -ivh jzlib-1.0.7-7.5.el6.x86_64.rpm
735 ls *ia*
736 rpm -ivh yum-plugin-aliases-1.1.30-6.el6.noarch.rpm
737 rpm -ivh libpciaccess-0.10.9-4.el6.x86_64.rpm 安装所有的相关包------ia相关包没找见 安装pci相关包
738 rpm -ivh libpciaccess-0.10.9-4.el6.i686.rpm
739 ls *libc6*
740 ls *c6*
741 ls *libc*
742 rpm -ivh glibc-2.12-1.25.el6.x86_64.rpm
743 rpm -ivh glibc-devel-2.12-1.25.el6.x86_64.rpm
744 rpm -ivh glibc-2.12-1.25.el6.i686.rpm
745 rpm -ivh glibc-common-2.12-1.25.el6.x86_64.rpm 安装libc所有的相关包
746 rpm -ivh glibc-devel-2.12-1.25.el6.x86_64.rpm
747 rpm -ivh glibc-devel-2.12-1.25.el6.i686.rpm
748 rpm -ivh glibc-headers-2.12-1.25.el6.x86_64.rpm
749 rpm -ivh glibc-utils-2.12-1.25.el6.x86_64.rpm
750 yum install glibc-utils
751 ls
752 ls *lsb*
753 rpm -ivh redhat-lsb-4.0-3.el6.x86_64.rpm
754 rpm -ivh redhat-lsb-graphics-4.0-3.el6.x86_64.rpm 安装lsb所有的相关包,怕有一些LSB兼容性的问题
755 rpm -ivh redhat-lsb-printing-4.0-3.el6.x86_64.rpm
756 rpm -ivh redhat-lsb-4.0-3.el6.i686.rpm
757 yum install redhat-lsb-4.0-3.el6.i686
758 ls
759 su - wgj1 切换到之前的用户,,一切都变得正常了!!
感觉今天有点小成就,又解决了一个问题,积硅步至千里!!!
------------------追更:现在我可能找到了根源,,,之前我在该用户下使用的是 默认的 bash ----之后在这个环境下我启动了 zookeeper和kafka集群 ,,,之后又在该用户下编译了公司的代码,,,修改为csh,,,,,可能当时是这个原因照成上述情况,,,,之后我在该目录下 安装了flume 在该用户的 .bashrc 里边增加了java的环境变量!后边执行了 flume 或者 kafka bin下边的其他依赖java环境的脚本 命令,,,之后报的这个错,,,建议看完这边文章的朋友,先检查一下自己的 shell 看是不是 shell 引起的冲突!!!