错误记录编译 Linux 内核报错 ( /bin/sh: 1: bison: not found )

Posted 韩曙亮

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误记录编译 Linux 内核报错 ( /bin/sh: 1: bison: not found )相关的知识,希望对你有一定的参考价值。

文章目录





一、报错信息



编译 Linux 内核 , 执行

make menuconfig

配置菜单命令 , 报如下错误 :

root@ubuntu:~/kernel/linux-5.6.14# make menuconfig
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
/bin/sh: 1: bison: not found
scripts/Makefile.host:17: recipe for target 'scripts/kconfig/parser.tab.h' failed
make[1]: *** [scripts/kconfig/parser.tab.h] Error 127
Makefile:568: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
root@ubuntu:~/kernel/linux-5.6.14# 





二、解决方案



执行

sudo apt-get install bison

命令 , 安装 bison ;

安装过程如下 :

root@ubuntu:~/kernel/linux-5.6.14# sudo apt-get install bison -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libbison-dev
Suggested packages:
  bison-doc
The following NEW packages will be installed:
  bison libbison-dev
0 upgraded, 2 newly installed, 0 to remove and 154 not upgraded.
Need to get 597 kB of archives.
After this operation, 1,795 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libbison-dev amd64 2:3.0.4.dfsg-1 [338 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 bison amd64 2:3.0.4.dfsg-1 [259 kB]
Fetched 597 kB in 2s (252 kB/s)
Selecting previously unselected package libbison-dev:amd64.
(Reading database ... 212318 files and directories currently installed.)
Preparing to unpack .../libbison-dev_2%3a3.0.4.dfsg-1_amd64.deb ...
Unpacking libbison-dev:amd64 (2:3.0.4.dfsg-1) ...
Selecting previously unselected package bison.
Preparing to unpack .../bison_2%3a3.0.4.dfsg-1_amd64.deb ...
Unpacking bison (2:3.0.4.dfsg-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libbison-dev:amd64 (2:3.0.4.dfsg-1) ...
Setting up bison (2:3.0.4.dfsg-1) ...
update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode
root@ubuntu:~/kernel/linux-5.6.14# 

以上是关于错误记录编译 Linux 内核报错 ( /bin/sh: 1: bison: not found )的主要内容,如果未能解决你的问题,请参考以下文章

错误记录编译 Linux 内核报错 ( Unable to find the ncurses package. )

错误记录编译 Linux 内核报错 ( fatal error: openssl/opensslv.h: No such file or directory )

Linux 内核编译 Linux 内核 ⑥ ( 安装 OpenSSL | 安装其它依赖库 | 内核编译完成 )

错误记录Ubuntu 安装 Linux 内核后需要重新安装 VMware Tools 软件进行兼容操作

Linux 内核编译 Linux 内核 ③ ( 安装 ncurses | 安装 flex | 安装 bison | 打开 Linux 内核编译配置菜单 )

Linux 0.11内核编译错误记录