这篇文章主要介绍“Ubuntu更新系统内核出错后的问题怎么解决”,在日常操作中,相信很多人在Ubuntu更新系统内核出错后的问题怎么解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ubuntu更新系统内核出错后的问题怎么解决”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
因为要更新的软件比较多,需要花费挺长时间,也没怎么在意,只是在运行结束后看了一下报错,上面显示因为boot分区空间不够,升级linux内核的时候出错了:
在处理时有错误发生:linux-image-extra-4.4.0-97-genericlinux-image-genericlinux-genericE: Sub-process /usr/bin/dpkg returned an error code (1)
之前也发生了同样的问题,系统提示可以运行sudo apt-get autoremove清除不需要的依赖的,而多次升级后/boot分区里已经有了多个之前版本的Linux内核,因此编程网决定先运行一下这个命令,看能不能自动给/boot分区清理出一部分空间来,这样也省得我再查文档手动清除旧的内核文件了。实验证明这个命令真的有效果,/boot分区清理出了100多M的空间,应该也够安装新的内核了。
再次执行sudo apt update/sudo apt upgrade, 系统并没有接着安装上次没有完成安装的内核,而是报错如下:
davidbro@Workstation:~$ sudo apt upgrade正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成 正在计算更新... 完成有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件包尚未被创建或是它们已被从新到(Incoming)目录移出。下列信息可能会对解决问题有所帮助:下列软件包有未满足的依赖关系: linux-image-extra-4.4.0-96-generic : 依赖: linux-image-4.4.0-96-generic 但是它将不会被安装E: 破损的软件包
试一下sudo apt install命令看看不能能安装:
david@KingChef-Workstation:~$ sudo apt-get install正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包将被【卸载】: linux-image-extra-4.4.0-96-generic升级了 0 个软件包,新安装了 0 个软件包,要卸载 1 个软件包,有 0 个软件包未被升级。有 5 个软件包没有被完全安装或卸载。解压缩后将会空出 153 MB 的空间。您希望继续执行吗? [Y/n] Y(正在读取数据库 ... 系统当前共安装有 356556 个文件和目录。)正在卸载 linux-image-extra-4.4.0-96-generic (4.4.0-96.119) ...depmod: FATAL: could not load /boot/System.map-4.4.0-96-generic: No such file or directoryrun-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericrun-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericError! Your kernel headers for kernel 4.4.0-96-generic cannot be found.Please install the linux-headers-4.4.0-96-generic package,or use the --kernelsourcedir option to tell DKMS where it's locatedError! Your kernel headers for kernel 4.4.0-96-generic cannot be found.Please install the linux-headers-4.4.0-96-generic package,or use the --kernelsourcedir option to tell DKMS where it's locatedrun-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericupdate-initramfs: Generating /boot/initrd.img-4.4.0-96-genericWARNING: missing /lib/modules/4.4.0-96-genericEnsure all necessary drivers are built into the linux image!depmod: ERROR: could not open directory /lib/modules/4.4.0-96-generic: No such file or directorydepmod: FATAL: could not search modules: No such file or directorydepmod: WARNING: could not open /var/tmp/mkinitramfs_pkdOqR/lib/modules/4.4.0-96-generic/modules.order: No such file or directorydepmod: WARNING: could not open /var/tmp/mkinitramfs_pkdOqR/lib/modules/4.4.0-96-generic/modules.builtin: No such file or directoryrun-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericrun-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericrun-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericrun-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-96-generic /boot/vmlinuz-4.4.0-96-genericGenerating grub configuration file ...Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.Found linux image: /boot/vmlinuz-4.4.0-130-genericFound initrd image: /boot/initrd.img-4.4.0-130-genericFound linux image: /boot/vmlinuz-4.4.0-98-genericFound initrd image: /boot/initrd.img-4.4.0-98-genericFound linux image: /boot/vmlinuz-3.5.0-54-genericFound initrd image: /boot/initrd.img-3.5.0-54-genericFound linux image: /boot/vmlinuz-3.5.0-23-genericFound initrd image: /boot/initrd.img-3.5.0-23-genericdone正在设置 initramfs-tools (0.122ubuntu8.11) ...update-initramfs: deferring update (trigger activated)正在设置 linux-image-extra-4.4.0-130-generic (4.4.0-130.156) ...run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericrun-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericERROR: Cannot create report: [Errno 17] File exists: '/var/crash/i915-4.6.3-4.4.0-dkms.0.crash'Error! Bad return status for module build on kernel: 4.4.0-130-generic (x86_64)Consult /var/lib/dkms/i915-4.6.3-4.4.0/1/build/make.log for more information.run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericupdate-initramfs: Generating /boot/initrd.img-4.4.0-130-genericrun-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericrun-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericrun-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericrun-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-genericGenerating grub configuration file ...Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.Found linux image: /boot/vmlinuz-4.4.0-130-genericFound initrd image: /boot/initrd.img-4.4.0-130-genericFound linux image: /boot/vmlinuz-4.4.0-98-genericFound initrd image: /boot/initrd.img-4.4.0-98-genericFound linux image: /boot/vmlinuz-3.5.0-54-genericFound initrd image: /boot/initrd.img-3.5.0-54-genericFound linux image: /boot/vmlinuz-3.5.0-23-genericFound initrd image: /boot/initrd.img-3.5.0-23-genericdone正在设置 linux-image-generic (4.4.0.130.136) ...正在设置 linux-generic (4.4.0.130.136) ...正在处理用于 initramfs-tools (0.122ubuntu8.11) 的触发器 ...update-initramfs: Generating /boot/initrd.img-4.4.0-130-generic
这样最新的内核版本4.4.0.130.136就安装好了。其实我觉得这样用autoremove腾出分区空间还是有点风险的,有可能会误删掉其他有用的软件。
到此,关于“Ubuntu更新系统内核出错后的问题怎么解决”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程网网站,小编会继续努力为大家带来更多实用的文章!