当前位置: 首页 > news >正文

Ubuntu2204降内核版本

一,需求

在使用Ubuntu2204编译Android7和Android9时会出现一些错误,

如: 报错提示dex2oatd E 217979 217979 art/runtime/gc/heap.cc:324] Could not create image

是由于编译环境ubuntu24.04使用的内核为6.5.0-28版本,这里需要使用小于 5.17.

所以我们需要降低内核版本。

二,下载内核源码

sudo apt-get install linux-source-5.15.0
cd /usr/src/
tar -xvf  linux-source-5.15.0.tar.bz2
cd /usr/src/linux-source-5.15.0
cp /boot/config-5.15.0-97-generic  /usr/src/linux-source-5.15.0/.configcd /usr/src/linux-source-5.15.0make -j8出现错误:安装下面软件包
sudo apt-get install dwarves
配置.config文件  vim .config
CONFIG_DEBUG_INFO_BTF = n

二,编译内核

make -j4

三,安装模块

make modules_install

四,安装内核

make install

五,配置启动

配置系统启动选项,设置选择上次保存(默认选择上次运行的内核进行启动)
配置grub文件
配置项目:
GRUB_DEFAULT=savedGRUB_SAVEDEFAULT=true

修改grub文件

joyusing@joyusing-HFMP:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'GRUB_DEFAULT=saved
#"Advanced options for Ubuntu>Ubuntu, with with Linux 5.15.189"
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_SAVEDEFAULT=true
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

六,重启系统,到配置菜单

在重启时按住shift按键,进入Advanced options for Ubuntu的菜单,

选择我们编译的内核:5.15.189

进入系统后: uname -r

http://www.dtcms.com/a/581166.html

相关文章:

  • 数据在网络上的转发过程
  • 跨地域传文件太麻烦?Nginx+cpolar 让本地服务直接公网访问
  • ASP.NET MVC 数据验证进阶:用 IValidatableObject 实现自定义验证逻辑 引言:为什么需要 “自定义验证”?
  • 网站流量报表摄像头怎么做直播网站
  • XMOS与飞腾云联袂以模块化方案大幅加速音频产品落地
  • AI 下的 Agent 技术全览
  • 唐山免费网站制作wordpress企业cms开发
  • Windows 里用 Linux 不卡顿?WSL + cpolar让跨系统开发变简单
  • Java 全栈 Devs【应用】:用Spring Boot、MinIO 实现文件上传存储,结合 OnlyOffice 实现文件预览
  • 优化SEO表现的方法:有效利用关键词和长尾关键词的策略
  • 协同感知:未来智能系统的“神经中枢”与跨域融合引擎
  • 做淘宝客网站的流程4399网页版入口
  • 氛围编程走远,规格驱动开发降临
  • 硅基计划6.0 JavaEE 叁 文件IO
  • python+django/flask的篮球馆/足球场地/运动场地预约系统
  • 网站做零售node.js网站开发框架
  • AUTOSAR Adaptive Platform ——Platform Health Management (PHM)
  • 云空间网站qq刷赞网站如何做分站
  • 【技术教程】Python/Node.js 调用拼多多商品详情 API 示例详解
  • 微软加速在亚洲扩展云基础设施,推动区域数字化跨越式发展
  • 八股已死、场景当立(场景篇-分布式ID)
  • LeetCode 刷题【147. 对链表进行插入排序】
  • XMSRC4194_VC1:4通道192KHz ASRC音频采样率转换器产品介绍
  • 2025.11.06 力扣每日一题
  • Linux入门攻坚——53、drbd - Distribute Replicated Block Device,分布式复制块设备-2
  • 视频文件上传至服务器后浏览器无法在线播放
  • 鹤壁市建设工程交易中心网站魔改wordpress主题
  • 前端打包工具 - Rollup 打包工具笔记
  • 北大 UCLA 推出 ROCKET-2,AI 助力 3D 游戏零样本迁移
  • Linux 抓取 RAM Dump 完整指南