Mosh 是个好东西,能长时间保持 SSH 的连接不断掉。 今天折腾了一个韩国的 vps ( centos 6 ),可以免费试用一个月。它的源无法直接安装 mosh ,于是折腾了一下,做个笔记。
cd /usr/local/data
wget https://mosh.org/mosh-1.2.6.tar.gz
tar -zxvf mosh-1.2.6.tar.gz
cd mosh-1.2.6
./config
make
make install
中间遇到几个问题
configure: error: in `/usr/local/data/mosh-1.2.6':
configure: error: no acceptable C compiler found in $PATH
这个通过安装 gcc 解决
yum install gcc
checking for protoc... no
configure: error: cannot find protoc, the Protocol Buffers compiler
尝试
yum install -y protobuf-devel
已加载插件: fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: ftp.daumkakao.com
* updates: ftp.daumkakao.com
No package protobuf-devel available.
好吧
cd..
git clone https://github.com/google/protobuf.git
cd protobuf
./autogen.sh
然后提示
./autogen.sh: line 35: unzip: command not found
只好
yum -y install unzip
然后再次运行 autogen.sh
autoreconf -f -i -Wall,no-obsolete
./autogen.sh: line 48: autoreconf: command not found
需要
yum -y install autoconf
然后还是
Can't exec "automake": 没有那个文件或目录 at /usr/bin/autoreconf line 242.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 242.
Can't exec "aclocal": 没有那个文件或目录 at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: 没有那个文件或目录
于是
yum -y install automake autoconf
但是还
+ autoreconf -f -i -Wall,no-obsolete
configure.ac:30: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
我晕了,继续搜索,找到解决方案
yum install -y libtool libsysfs-dev
这下./autogen.sh 不报错了,但是./configure 报如下错误
configure: error: in `/usr/local/data/protobuf':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
于是
yum -y install glibc-headers gcc-c++
然后下面三个命令就都顺利了
./configure
make
make install
回到 mosh-1.2.6 目录下./configure 遇到问题:
configure: error: Unable to find zlib.
于是
yum install zlib-devel
但是再次 configure 又有
configure: error: OpenSSL crypto library not found
yum install -y openssl-devel
不过还是又有错误
checking for protobuf... no
configure: error: Package requirements (protobuf) were not met:
No package 'protobuf' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables protobuf_CFLAGS
and protobuf_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
解决办法,重新编译 protobuf
cd ../protobuf
./configure – prefix=/usr – libdir=/usr/lib64
make clean
make && make install
然后回到 mosh-1.2.6 目录下
./configure
make && make install
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.