linux-6.5.4 の Ubuntu Server 22.04.3 へのインストール

linux-6.4.12 の Ubuntu Server 22.04.2へのインストールログです.複数のトラブルが発生します.

sudo su -
apt -y update
apt -y install make gcc make gcc flex bison libelf-dev libssl-dev
cd /usr/src
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.4.tar.xz
tar xfJ linux-6.5.4.tar.xz
cd linux-6.5.4
cp /boot/config-5.15.0-84-generic .config
yes "" | make oldconfig

もし
Command 'make' not found, but can be installed with:
apt install make # version 4.3-4.1build1, or
apt install make-guile # version 4.3-4.1build1

となってしまったら
apt -y install make
を忘れています

もし
HOSTCC scripts/basic/fixdep
/bin/sh: 1: gcc: not found
make[2]: *** [scripts/Makefile.host:114: scripts/basic/fixdep] Error 127
make[1]: *** [/usr/src/linux-6.5.4/Makefile:641: scripts_basic] Error 2
make: *** [Makefile:234: __sub-make] Error 2

となってしまったら
apt -y install gcc
を忘れています

もし
LEX scripts/kconfig/lexer.lex.c
/bin/sh: 1: flex: not found
make[2]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127
make[1]: *** [/usr/src/linux-6.5.4/Makefile:705: oldconfig] Error 2
make: *** [Makefile:234: __sub-make] Error 2

となってしまったら
apt -y install flex
を忘れています

もし
YACC scripts/kconfig/parser.tab.[ch]
/bin/sh: 1: bison: not found
make[2]: *** [scripts/Makefile.host:17: scripts/kconfig/parser.tab.h] Error 127
make[1]: *** [/usr/src/linux-6.5.4/Makefile:705: oldconfig] Error 2
make: *** [Makefile:234: __sub-make] Error 2

となってしまったら
apt -y install bison
を忘れています

cp .config .config.bak
vi .config

vi .config は以下の2カ所の修正をする

11248行目
CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"

CONFIG_SYSTEM_TRUSTED_KEYS=""

11255行目
CONFIG_SYSTEM_REVOCATION_KEYS="debian/canonical-revoked-certs.pem"

CONFIG_SYSTEM_REVOCATION_KEYS=""

make -j8 bzImage modules

もし
<stdin>:1:10: fatal error: libelf.h: No such file or directory
compilation terminated.
INSTALL libsubcmd_headers
CC /usr/src/linux-6.5.4/tools/objtool/arch/x86/special.o
In file included from /usr/src/linux-6.5.4/tools/objtool/include/objtool/objtool.h:13,
from /usr/src/linux-6.5.4/tools/objtool/include/objtool/arch.h:11,
from /usr/src/linux-6.5.4/tools/objtool/include/objtool/check.h:11,
from /usr/src/linux-6.5.4/tools/objtool/include/objtool/special.h:10,
from arch/x86/special.c:4:
/usr/src/linux-6.5.4/tools/objtool/include/objtool/elf.h:10:10: fatal error: gelf.h: No such file or directory
10 | #include <gelf.h>
| ^~~~~~~~
compilation terminated.
make[5]: *** [/usr/src/linux-6.5.4/tools/build/Makefile.build:98: /usr/src/linux-6.5.4/tools/objtool/arch/x86/special.o] Error 1
make[4]: *** [/usr/src/linux-6.5.4/tools/build/Makefile.build:150: arch/x86] Error 2
make[3]: *** [Makefile:66: /usr/src/linux-6.5.4/tools/objtool/objtool-in.o] Error 2
make[2]: *** [Makefile:73: objtool] Error 2
make[1]: *** [/usr/src/linux-6.5.4/Makefile:1440: tools/objtool] Error 2
make: *** [Makefile:234: __sub-make] Error 2

となってしまったら
apt -y install libelf-dev
を忘れています

もし
scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
25 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:114: scripts/sign-file] Error 1
make[1]: *** [/usr/src/linux-6.5.4/Makefile:1271: scripts] Error 2
make: *** [Makefile:234: __sub-make] Error 2

となってしまったら
apt -y install libssl-dev
を忘れています

make modules_install install

#linux
#ubuntu
#カーネル
#kernel
#Ubuntu22
#Ubuntu22_04
#Ubuntu22_04_3
#JammyJellyfish
#linux6
#linux6_5
#linux6_5_4


この記事が気に入ったらサポートをしてみませんか?