欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > Linux 编译Ubuntu24内核

Linux 编译Ubuntu24内核

2025/2/23 18:41:53 来源:https://blog.csdn.net/weixin_41432198/article/details/143951364  浏览:    关键词:Linux 编译Ubuntu24内核

参考来源:
编译并更新内核:https://www.cnblogs.com/smlile-you-me/p/18248433
编译报错–sub-make: https://forum.linuxfoundation.org/discussion/865005/facing-error-in-building-the-kernel

1.下载源码,执行如下命令,会在/usr/src下多出一个 内核压缩包文件此处举例:

sudo apt update
sudo apt install linux-source

2.解压缩:

cd /usr/src
tar -xvf lin linux-source-6.8.0.tar.bz2

3.复制当前ubuntu的内核配置文件

sudo cp /boot/config-6.8.0-49-generic ./
sudo cp config-6.8.0-49-generic .config

4.安装编译内核所需的软件包和工具

sudo apt update
sudo apt install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev bc git

5.制作config文件

sudo make oldconfig

5.1 根据需要修改.config中的这2个配置:
CONFIG_USBIP_VHCI_NR_HCS=8
CONFIG_USBIP_VHCI_HC_PORTS=31

6.取消这2个配置:

sudo scripts/config --disable SYSTEM_TRUSTED_KEYS
sudo scripts/config --disable SYSTEM_REVOCATION_KEYS

7.通过nano 进入.config 文件将这2个配置相关的关闭掉

8.编译:

sudo make -j$(nproc)
  1. 安装编译好的内核模块
sudo make modules_install

10.安装新编译的内核

 sudo make install
  1. 编译并打包内核为 .deb 包
sudo apt-get install -y debhelper dh-virtualenv 
sudo make -j$(nproc) bindeb-pkg

12 安装内核的 .deb 包

sudo dpkg -i ../linux-*.deb
  1. 更新 GRUB 配置
sudo update-grub

14 重启来加载新安装的内核

sudo reboot

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词