1,查看当前系统内核 :
uname -a
Linux ubuntu 4.10.0-27-generic #30~16.04.2-Ubuntu SMP Thu Jun 29 16:07:46 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
2,下载最新版内核:
www.kernel.org
linux-4.12.3.tar.xz
3.拷贝到/usr/src目录下,用 tar -xvf linux-3.14.tar.gz 命令解压
4.切换至解压后的源码目录下,sudo su 进入超级权限模式
5.apt-get install libncurses-dev,安装 make menuconfig时需要用到的库文件
6.执行make menuconfig,选择配置后会生成 .config文件
make: *** No rule to make target 'menuconfig'. Stop.
需要进入到 /usr/src/linux-4.12.3目录
7. make 编译 (这个过程较长,1~2小时左右)
scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
scripts/Makefile.host:107: recipe for target 'scripts/sign-file' failed
make[1]: *** [scripts/sign-file] Error 1
Makefile:562: recipe for target 'scripts' failed
make: *** [scripts] Error 2
出现这个或者fatal error: openssl/opensslv.h: No such file or directory。都是没有安装libssl-dev~
libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现~
解决方案:
8.make modules 编译模块
9.make modules_install 安装模块
10.make install 安装内核
11.reboot 计算机,用uname -a
Linux ubuntu 4.12.3 #1 SMP Wed Jul 26 11:24:46 PDT 2017 x86_64 x86_64 x86_64 GNU/Linux