在Ubuntu 18.04.1上编译OpenWrt Chaos Calmer的时候碰到了以下问题,记录一下。
Build dependency: Please install the GNU C Compiler (gcc)
Build dependency: Please reinstall the GNU C Compiler - it appears to be broken
Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken
Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
Build dependency: Please install zlib. (Missing libz.so or zlib.h)
Build dependency: Please install the openssl library (with development headers)
Build dependency: Please install Python 2.x
Build dependency: Please install the Subversion client
Build dependency: Please install Git (git-core) >= 1.6.5
如果有碰到提示 - Unable to locate package xxx
请先参考https://blog.csdn.net/xiangxianghehe/article/details/80112149
把源换成国内源
$ sudo apt-get install gcc
$ sudo apt-get install g++
$ sudo apt-get install ocaml
注:此处用Ubuntu原来的源会碰到错误提示“Unable to locate package ocaml”,更换为阿里云后正常安装
$ sudo apt-get install libncurses5-dev
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install python
$ sudo apt-get install subversion
$ sudo apt-get install git
注:如果已经安装git但是仍然收到该错误提示,请参考原因二,如果没有请忽略原因二。
查看git版本
$ git --version
git version 2.17.1
由于对git版本的检测方式有缺陷导致,OpenWRT已经在
2016-03-05 21:07提交(4c80909fa141fe2921c62bd17b2b04153031df18)中修复该问题
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
- git clone 2>&1 | grep -- --recursive))
+ git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))