GRUB_CMDLINE_LINUX_DEFAULT: not found

Ubuntu旧内核无法删除,无法更新和下载软件。
具体错误:

uname -a
Linux cch 5.4.0-124-generic #140~18.04.1-Ubuntu SMP Fri Aug 5 11:43:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
 
sudo apt-get remove linux-image-5.4.0-122-generic 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包将被【卸载】:
  linux-image-5.4.0-122-generic
升级了 0 个软件包,新安装了 0 个软件包,要卸载 1 个软件包,有 53 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
解压缩后将会空出 11.0 MB 的空间。
您希望继续执行吗? [Y/n] y
(正在读取数据库 ... 系统当前共安装有 289834 个文件和目录。)
正在卸载 linux-image-5.4.0-122-generic (5.4.0-122.138~18.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-122-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 11: /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: 处理软件包 linux-image-5.4.0-122-generic (--remove)时出错:
 installed linux-image-5.4.0-122-generic package post-removal script subprocess returned error exit status 1
在处理时有错误发生:
 linux-image-5.4.0-122-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
 

解决方案

sudo gedit /etc/default/grub 

找到 GRUB_CMDLINE_LINUX_DEFAULT,将其修改为:

GRUB_CMDLINE_LINUX_DEFAULT="text consoleblank=0 intel_pstate=disable net.ifnames=0 ipv6.disable=1 pci=noaer iommu=soft usbcore.autosuspend=-1 radeon.si_support=0 radeon.cik_support=0 amdgpu.vm_fragment_size=9 amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.ppfeaturemask=0xffff7fff amdgpu.runpm=0 amdgpu.gpu_recovery=0 noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off e1000e.EEE=0"

参考连接:
https://blog.csdn.net/linzhiji/article/details/117282826?ops_request_misc=&request_id=&biz_id=102&utm_term=GRUB_CMDLINE_LINUX_DEFAULT:%20no&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-117282826.142v51control_1,201v3add_ask&spm=1018.2226.3001.4187

你可能感兴趣的:(教程,linux,ubuntu,服务器)