处理包 linux-image-amd64 时出错

处理包 linux-image-amd64 时出错

每次升级几个月后我都会出现这个错误

>     master@vps726152:~$ sudo apt autoremove
>     Reading package lists... Done
>     Building dependency tree
>     Reading state information... Done
>     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
>     2 not fully installed or removed.
>     After this operation, 0 B of additional disk space will be used.
>     Setting up linux-image-4.9.0-14-amd64 (4.9.246-2) ...
>     /etc/kernel/postinst.d/initramfs-tools:
>     update-initramfs: Generating /boot/initrd.img-4.9.0-14-amd64
>     /etc/kernel/postinst.d/zz-update-grub:
>     /usr/sbin/grub-mkconfig: 11: /etc/default/grub: systemd.unified_cgroup_hierarchy=0: not found
>     run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
>     dpkg: error processing package linux-image-4.9.0-14-amd64 (--configure):
>      subprocess installed post-installation script returned error exit status 1
>     dpkg: dependency problems prevent configuration of linux-image-amd64:
>      linux-image-amd64 depends on linux-image-4.9.0-14-amd64; however:
>       Package linux-image-4.9.0-14-amd64 is not configured yet.
>     
>     dpkg: error processing package linux-image-amd64 (--configure):
>      dependency problems - leaving unconfigured
>     Errors were encountered while processing:
>      linux-image-4.9.0-14-amd64
>      linux-image-amd64
>     E: Sub-process /usr/bin/dpkg returned an error code (1)

Debian 在 VPS 上运行

> PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux"
> VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch
> ID=debian

怎么了 ?我该如何解决它?

这是我的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=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"
GRUB_CMDLINE_LINUX=""
systemd.unified_cgroup_hierarchy=0

# 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"

并改为(只是第一个块)

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="systemd.unified_cgroup_hierarchy=0"
#GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"
GRUB_CMDLINE_LINUX=""
#systemd.unified_cgroup_hierarchy=0

似乎可以解决问题。非常感谢。

答案1

查看您的/etc/default/grub文件:它包含以 开头的行systemd.unified_cgroup_hierarchy=0,该行无效。

该配置语句应该位于以 开头的行中GRUB_CMDLINE_LINUX_DEFAULT。把它移到那里,一切都会好起来的。如果您不知道如何解决问题,编辑你的问题添加完整内容/etc/default/grub,我将更新此内容以让您知道该怎么做。

相关内容