前置吐槽

不愧是前几年的包,可以拿来考古了。在使用ubuntu14.10和linux-3.19.1的环境下最终安包的时候死掉了,三天沉浸式暴毙安装
sudo apt-get install libncurses5-dev build-essential kernel-package
在这里插入图片描述
死因: 因为linux内核版本太久 找不到对应的包 就在这里弃疗

E: Unable to locate package lib32ncurses5
E: Unable to locate package kernel
E: Unable to locate package libncurses5-dev

实验环境

版本问题就使用比较新但是稳定的,最新的必不稳定,不信你看win11。VMware Workstation 16.2.1 Pro + Ubuntu Desktop 20.04.3 LTS + linux-5.10.78

问题合集与解决方案

Error 1. No space left on device
 给虚拟磁盘足够的内存,不同版本linux核心所占大小不同,这里核心几乎占了30G,笔者给磁盘分配了70G,在一开始就分配好磁盘空间将会节省工作量。

命令 part 1
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.78.tar.xz
sudo cp ./linux-5.10.78.tar.xz /usr/src
cd /usr/src
sudo tar xvJf ./linux-5.10.78.tar.xz
cd ./linux-5.10.78

在这里插入图片描述

命令 part 2
sudo apt-get install libncurses5-dev build-essential kernel-package
sudo make menuconfig

Error 2. /bin/sh: 1: flex: not found
下包即可
在这里插入图片描述

sudo apt-get install flex

Error 3. /bin/sh: 1: bison: not found
在这里插入图片描述
同理下包,转自blog

sudo apt-get install bison -y

Error 4. No rule to make target ‘menuconfig’.Stop.
 命令执行的命令不对,这里在根目录执行menuconfig,当然没有用,应该先用cd命令进入linux内核目录再执行sudo menuconfig。

cd /usr/src
cd ./linux-5.10.78
sudo make menuconfig

在这里插入图片描述
Error 5. Your display is too small to run Menuconfig!
虚拟机屏幕显示太小,装不下menuconfig菜单,最大化窗口即可。

Your display is too small to run Menuconfig!
It must be at least 19 lines by 80 columns.

请添加图片描述
 之后应该可以看到菜单选项,这里直接选择Exit,Yes保存设置
在这里插入图片描述
在这里插入图片描述

命令 part 3
sudo make
#如果处理器有八核的话 可以使用下面的命令多核编译 速度有肉眼可见的提升
sudo make -j8

Error 5. fatal error: gelf.h: No such file or directory
在这里插入图片描述

sudo apt-get install libelf-dev

Error 6. fatal error: openssl/opensslv.h: No such file or directory
在这里插入图片描述

sudo apt-get install libffi-dev

Error 7. No rule to make target 'debian/certs/benh@debian.org.cert.pem', needed by 'certs/x509_certificate_list'. Stop.
 1.需要进入 config文件修改
在这里插入图片描述

vim .config

 2.下载vim
在这里插入图片描述

sudo apt install vim

 3.进入管理员 删除CONFIG_SYSTEM_TRUSTED_KEYS的值。在config文件中找到三项的值,然后置空值,使用del键删除,退出vim编辑需要先按下ESC键,同时输入’ : ',在vim编辑器底部看到光标后注入"wq!",然后回车退出编辑。

sudo su
vim .config

在这里插入图片描述
这里我删了两个值,网上解决办法是删CONFIG_SYSTEM_TRUSTED_KEY中的值即可
在这里插入图片描述
Error 8. BTF: .tmp_vmlinux.btf: pahole (pahole) is not available.

#报错信息
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1106: vmlinux] Error 1

 经典下包

sudo apt install dwarves

命令
Error 9. FAILED:load BTF from vmlinux:No such file or directory

 同上进入.config文件,修改CONFIG_DEBUF_INFO_BTF的值从y改为n。在vim中光标闪烁不是编辑模式,不能输入,需要输入’ i '进入编辑模式,可以在左下角看到- -INSERT- -,ESC退出编辑模式。
在这里插入图片描述

命令 part 3
sudo make modules_install
sudo make install

Error 10. SSL error:02001002:system library:fopen:No such file or directory: …/crypto/bio/bss_file.c

INSTALL arch/x86/crypto/aegis128-aesni.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: …/crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: …/crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
scripts/Makefile.modinst:36: recipe for target ‘arch/x86/crypto/aegis128-aesni.ko’ failed
make[1]: *** [arch/x86/crypto/aegis128-aesni.ko] Error 1
Makefile:1281: recipe for target ‘modinst’ failed
make: *** [modinst] Error 2

原文链接:https://blog.csdn.net/m0_51203305/article/details/120809966

Final

 最终要求在启动菜单看到自定义的内容
在这里插入图片描述 启动linux时条跳过启动菜单,直接进入登录界面,因为配置文件自定义跳过了启动选项
在这里插入图片描述
在这里插入图片描述
 在make install命令之后,编辑/etc/default/grub文件

sudo su
gedit /etc/default/grub

 将GRUB_TIMEOUT_STYLE=hidden 注释掉,大概意思是不让选择启动项菜单隐藏。之后修改 GRUB_TIMEOUT = 10
GRUB_DISTRIUBUTOR_TIMEOUT=10,之后保存退出,在命令行输入sudo update-grub即可更新启动选项。参考blog:https://tinychen.com/20191224-ubuntu-change-grub/
在这里插入图片描述
之后修改/boot/grub/grub.cfg文件 找到menuentry后面的字符串,修改它的值,即可自定义启动菜单时的选项名称。

sudo su
gedit /boot/grub/grub.cfg

在这里插入图片描述
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐