UbuntuコンパイルOpenWRT 15.05ヒント「Build dependency:Please install the xxx」

6931 ワード

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源を国内源にかえる
Build dependency: Please install the GNU C Compiler (gcc)
Build dependency: Please reinstall the GNU C Compiler - it appears to be broken
の原因となる
gccコンパイラが欠けています
解決策
gccコンパイラのインストール
$ sudo apt-get install gcc

Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken
の原因となる
g++コンパイラが見つかりません
解決策
g++コンパイラのインストール
$ sudo apt-get install g++

Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later
の原因となる
ocamlコンパイラが見つかりません
解決策
ocamlコンパイラのインストール
$ sudo apt-get install ocaml

注意:ここでUbuntuの元のソースで「Unable to locate package ocaml」というエラーメッセージが表示されます.
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
の原因となる
libncursesが欠けています.so
解決策
インストールso
$ sudo apt-get install libncurses5-dev

Build dependency: Please install zlib. (Missing libz.so or zlib.h)
の原因となる
libzが欠けています.so
解決策
インストールlibz.so
$ sudo apt-get install zlib1g-dev

Please install the openssl library (with development headers)
の原因となる
Opensslライブラリが見つかりません
解決策
Opensslライブラリのインストール
$ sudo apt-get install libssl-dev

Build dependency: Please install Python 2.x
の原因となる
Python 2が欠けています
解決策
Python 2のインストール
$ sudo apt-get install python

Build dependency: Please install the Subversion client
の原因となる
サブバージョンがありません
解決策
サブバージョンのインストール
$ sudo apt-get install subversion

Build dependency: Please install Git (git-core) >= 1.6.5
原因1
gitが見つかりません
解決策
gitのインストール
$ sudo apt-get install git

注意:gitがインストールされていてもエラーメッセージが表示されている場合は、理由2を参照してください.理由2を無視してください.
原因2
gitはインストールされていますが、バージョンは2です.x
 git 
$ git --version
git version 2.17.1

gitバージョンの検出方式に欠陥があるため、OpenWRTは2016-03-05 21:07に提出された(4 c 80909 fa 141 fe 2921 c 62 bd 17 b 2 b 04153031 df 18)でこの問題を修復した.
解決策
参考までにhttps://github.com/openwrt/openwrt/commit/4c80909fa141fe2921c62bd17b2b04153031df18
ファイルの変更
include/prereq-build.mkにおけるgitバージョンの判断コマンド.
私の判断命令は依然として
git clone 2>&1 | grep – –recursive)),
に変更
git –exec-path | xargs -I % – grep -q – –recursive %/git-submodule))
$(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))