Ubuntu 下执行sh脚本 报错 :No such file or directory

前端之家收集整理的这篇文章主要介绍了Ubuntu 下执行sh脚本 报错 :No such file or directory前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Ubuntu 下执行sh脚本 报错 :-bash: ./build_xx.sh: /bin/sh^M: bad interpreter: No such file or directory

执行sh脚本报这个错,很是郁闷,但是目录下的确有这个文件

网上搜索找到答案--https://superuser.com/questions/344533/no-such-file-or-directory-error-in-bash-but-the-file-exists

原因:我的机器是64位的,需要32位的支持库。在Ubuntu 13.10及以后版本中依赖了 libncurses5:i386,libstdc+6:i386,and zlib1g:i386的包。

Android SDK requires 32-bit libraries. You probably are on 64-bit and need the 32-bit libs. Here are the troubleshooting directions fromdeveloper.android.com

For Ubuntu 13.10 (Saucy Salamander) and above,install thelibncurses5:i386,libstdc++6:i386,andzlib1g:i386packages using apt-get:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

For earlier versions of Ubuntu,241); white-space:pre-wrap">ia32-libspackage using apt-get:

apt-get install ia32-libs

所以执行如下命令进行安装包:

down vote
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
就可以了。

猜你在找的Ubuntu相关文章