ubuntu 22.04 LTS 内核从 5.15.0 升级到 6.6.0

发布于:2024-03-26 ⋅ 阅读:(145) ⋅ 点赞:(0)

ubuntu 22.04LTS 内核从 5.15.0 升级到 6.6.0

升级内核时报错

ubuntu22.04LTS源码编译升级内核时报错,

make[3]: *** No rule to make target 'n', needed by 'certs/x509_certificate_list'.  Stop.

其他类似错误:

make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'.  Stop.
make: *** [Makefile:1868: certs] Error 2

或者:

make[1]: *** No rule to make target 'debian/canonical-revoked-certs.pem', needed by 'certs/x509_revocation_list'.  Stop.
make: *** [Makefile:1868: certs] Error 2

解决方法

vim .config

#修改 CONFIG_SYSTEM_TRUSTED_KEYS 为空
CONFIG_SYSTEM_TRUSTED_KEYS=""

#修改CONFIG_SYSTEM_REVOCATION_KEYS 为空
CONFIG_SYSTEM_REVOCATION_KEYS=""

:wq 退出保存

执行下面的指令重新编译即可

make -j8

内核升级过程

wget https://git.kernel.org/torvalds/t/linux-6.6-rc7.tar.gz

tar -xzvf linux-6.6-rc7.tar.gz

cd linux-6.6-rc7
cp /boot/config-$(uname -r)    .config
#然后,运行以下命令以进行配置:在配置界面中可以根据需要修改内核选项;保存配置后退出。
make menuconfig

# 编译内核:
make -j8    # 【】我是这步报错的, 这步出现报错,按 ctrl + c 退出安装过程,然后按照上面方法进行配置,再执行这步

# 编译完成后,可以安装内核及其模块:
sudo make modules_install
sudo make install

# 更新引导程序
sudo update-grub
sudo reboot

# 验证新内核
uname -r

回滚到先前版本

#(1)启动时选择旧内核: 在系统启动时,通常会显示一个引导菜单,选择要启动的内核版本。
这通常是在 GRUB 引导菜单中完成的。在这个菜单中,选择先前的稳定内核版本,而不是新内核。

#(2)进入系统: 选择旧内核后,让系统继续启动。

# 查看系统上已安装的内核包列表:
dpkg --list | grep linux-image

# (3)卸载新内核
sudo apt-get purge <新内核包名>

# 更新引导程序
sudo update-grub

# 重新启动系统
sudo reboot

# 验证内核版本
uname -r
本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到