0x01:打算在VPS上安装个Google的网盘,环境需要安装OPAM,在检查环境时就提示缺少not found的一些包。
#./configure
checking for OCaml findlib package unix... foundchecking for OCaml findlib package extlib... not foundchecking for OCaml findlib package re... not foundchecking for OCaml findlib package re.str... not foundchecking for OCaml findlib package re.pcre... not foundchecking for OCaml findlib package re.glob... not foundchecking for OCaml findlib package cmdliner... not foundchecking for OCaml findlib package ocamlgraph... not foundchecking for OCaml findlib package cudf... not foundchecking for OCaml findlib package dose3.common... not foundchecking for OCaml findlib package dose3.algo... not foundchecking for OCaml findlib package jsonm... not found
0x02:心想也许直接make能过去,结果是下面一样报错了。
#make
make -C src opam-libmake[1]: Entering directory '/home/roott/opam/src'make[1]: *** No rule to make target 'opam-lib'. Stop.make[1]: Leaving directory '/home/roott/opam/src'Makefile:26: recipe for target 'opam-lib' failedmake: *** [opam-lib] Error 2
0x03:按照检查提示,用‘make lib-ext’可以自动下载。
============================================================================Some dependencies are missing. If you are just interested in the stand-alone'opam' binary, run 'make lib-ext' to download and include them.============================================================================
0x04:经过make lib-ext后下载原来链接失效了,造成cppo-1.1.2.tar.gz解压失败。
# make lib-extmake -C src_ext lib-extmake[1]: Entering directory '/home/roott/opam/src_ext'[ -e cppo-1.1.2.tar.gz ] || curl -OL http://mjambon.com/releases/cppo/cppo-1.1.2.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 9340 100 9340 0 0 97476 0 --:--:-- --:--:-- --:--:-- 97291ocaml ../shell/md5check.ml cppo-1.1.2.tar.gz f1a551639c0c667ee8840d95ea5b2ab7MD5 for cppo-1.1.2.tar.gz differ: expected: f1a551639c0c667ee8840d95ea5b2ab7 actual: baeb004575d58a7b186737a3be6d5f07mkdir -p tmpcd tmp && tar xfz ../cppo-1.1.2.tar.gztar (child): ../cppo-1.1.2.tar.gz: Cannot open: No such file or directorytar (child): Error is not recoverable: exiting nowtar: Child returned status 2tar: Error is not recoverable: exiting nowMakefile:58: recipe for target 'cppo.stamp' failedmake[1]: *** [cppo.stamp] Error 2make[1]: Leaving directory '/home/roott/opam/src_ext'Makefile:29: recipe for target 'lib-ext' failedmake: *** [lib-ext] Error 2
0x05:到/home/root/opam/src_ext目录下看到文件只有45字节肯定不对。
-rwxrwxr-x 1 root root 45 Jun 20 15:15 cppo-1.1.2.tar.gz
0x06:原链接失效只能手动下载cppo-1.1.2.tar.gz,google找到一个github上的一个链接
# wget https://github.com/mjambon/cppo/archive/v1.1.2.tar.gz
0x07:解压cppo将里面文件覆盖到opam文件夹里。我的opam放在home下
#tar -zxf v1.1.2.tar.gz#mv -f cppo-1.1.2/ ~/opam/
0x08:覆盖完再次‘make’,成功。
make[15:35:12]echo 'let cppo_version = "1.1.2"' > cppo_version.ml[15:35:12]ocamlyacc cppo_parser.mly[15:35:12]ocamllex cppo_lexer.mll[15:35:12]368 states, 13139 transitions, table size 54764 bytes[15:35:12]3729 additional bytes used for bindings[15:35:12]ocamlopt -o cppo -dtypes unix.cmxa str.cmxa cppo_version.ml cppo_types.ml cppo_parser.mli cppo_parser.ml cppo_lexer.ml cppo_command.ml cppo_eval.ml cppo_main.ml[15:35:14]cd ocamlbuild_plugin && ocamlbuild -use-ocamlfind ocamlbuild_cppo.cma ocamlbuild_cppo.cmxa ocamlbuild_cppo.a ocamlbuild_cppo.cmxs[15:35:15]Finished, 8 targets (0 cached) in 00:00:00.[15:35:31]roott@LosAngeles:~/opam$ sudo make install[15:35:37][sudo] password for roott: [15:35:38]install -m 0755 cppo /usr/local/bin || \[15:35:38] install -m 0755 cppo.exe /usr/local/bin[15:35:38]ocamlfind install -patch-version 1.1.2 "cppo_ocamlbuild" \[15:35:38] META ocamlbuild_plugin/_build/ocamlbuild_cppo.cmi ocamlbuild_plugin/_build/ocamlbuild_cppo.cma ocamlbuild_plugin/_build/ocamlbuild_cppo.cmxa ocamlbuild_plugin/_build/ocamlbuild_cppo.a ocamlbuild_plugin/_build/ocamlbuild_cppo.cmxs[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmxs[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.a[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmxa[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cma[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmi[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/META
0x09:在下面就是安装。
#sudo make install