Announcement

Collapse
No announcement yet.

Errors were encountered while processing grub-pc

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Errors were encountered while processing grub-pc

    Last week, following a failure to upgrade a kernel, which forced me to use "grub>" commands to recover, I began receiving the following message every time I used apt.

    Errors were encountered while processing:
    grub-pc
    linux-image-5.14.0-1032-oem
    Here is an example of the full error message:
    /boot/grub/grub.cfg.new file attached.
    dpkg: error processing package grub-pc (--configure):
    installed grub-pc package post-installation script subprocess returned error exit status 1
    Processing triggers for linux-image-5.14.0-1032-oem (5.14.0-1032.35) ...
    /etc/kernel/postinst.d/initramfs-tools:
    update-initramfs: Generating /boot/initrd.img-5.14.0-1032-oem
    /etc/kernel/postinst.d/zz-update-grub:
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/99_breeze-grub.cfg'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
    Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing
    Syntax errors are detected in generated GRUB config file.
    Ensure that there are no errors in /etc/default/grub
    and /etc/grub.d/* files or please file a bug report with
    /boot/grub/grub.cfg.new file attached.
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
    dpkg: error processing package linux-image-5.14.0-1032-oem (--configure):
    installed linux-image-5.14.0-1032-oem package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    grub-pc
    linux-image-5.14.0-1032-oem
    I immediately tried
    sudo dpkg --configure -a
    sudo apt install -f
    but both failed with the same message given above, regardless of how many times I repeated them.
    I also tried reinstalling grub-pc, and the kernel, but that didn't resolve the problem either.

    I decided to do some dorking and found this solution, which worked nicely.
    sudo apt purge grub-pc grub-common
    sudo rm -r /etc/grub.d/
    sudo apt install grub-pc grub-common
    sudo grub-install /dev/sda
    sudo update-grub
    Remember, once you remove /etc/grub.d directory you can't reboot until you complete the following three commands.


    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    grub-pc is the BIOS version of grub. If you have a UEFI system you should have grub-efi or grub-efi-bin, and you don't need grub-pc.
    Regards, John Little

    Comment


      #3
      Originally posted by jlittle View Post
      grub-pc is the BIOS version of grub. If you have a UEFI system you should have grub-efi or grub-efi-bin, and you don't need grub-pc.
      I know next to nothing about EFI or Secure Boot. When I installed Neon, or Kubuntu for that matter, I had a choice between MBR and GPT. Since 16.04 I've always used GPT because it allowed more than four partitions, but with BTRFS that's a moot topic now. So, in selecting GPT I followed the installer directions for the manual mode (required for a BTRFS install), which dictated that I should create an unformatted EFI partition and set its flag to "bios-flag", IIRC, which I did. The installation had been running fine for seven months, until -1032-oem's install failed and caused the next boot to fail. Some how it messed up grub-pc. Grub-efi and grub-efi-bin are not installed on this notebook.
      ~$ tree /boot/
      Code:
      /boot/
      ├── config-5.14.0-1031-oem
      ├── config-5.14.0-1032-oem
      ├── efi
      │ └── EFI
      │ ├── BOOT
      │ │ ├── BOOTX64.EFI
      │ │ ├── fbx64.efi
      │ │ └── mmx64.efi
      │ ├── neon
      │ │ ├── BOOTX64.CSV
      │ │ ├── grub.cfg
      │ │ ├── grubx64.efi
      │ │ ├── mmx64.efi
      │ │ └── shimx64.efi
      │ └── ubuntu
      │ └── grub.cfg
      There is a TON of stuff in /boot/grub/x86_64-efi, but I have no clue as to what it all does. Probably nothing.
      ~$ tree /boot/grub/x86_64-efi
      Code:
      /boot/grub/x86_64-efi
      ├── acpi.mod
      ├── adler32.mod
      ├── affs.mod
      ├── afs.mod
      ├── ahci.mod
      ├── all_video.mod
      ├── aout.mod
      ├── appleldr.mod
      ├── archelp.mod
      ├── ata.mod
      ├── at_keyboard.mod
      ├── backtrace.mod
      ├── bfs.mod
      ├── bitmap.mod
      ├── bitmap_scale.mod
      ├── blocklist.mod
      ├── boot.mod
      ├── bsd.mod
      ├── bswap_test.mod
      ├── btrfs.mod
      ├── bufio.mod
      ├── cat.mod
      ├── cbfs.mod
      ├── cbls.mod
      ├── cbmemc.mod
      ├── cbtable.mod
      ├── cbtime.mod
      ├── chain.mod
      ├── cmdline_cat_test.mod
      ├── cmp.mod
      ├── cmp_test.mod
      ├── command.lst
      ├── configfile.mod
      ├── core.efi
      ├── cpio_be.mod
      ├── cpio.mod
      ├── cpuid.mod
      ├── crc64.mod
      ├── cryptodisk.mod
      ├── crypto.lst
      ├── crypto.mod
      ├── cs5536.mod
      ├── ctz_test.mod
      ├── datehook.mod
      ├── date.mod
      ├── datetime.mod
      ├── diskfilter.mod
      ├── disk.mod
      ├── div.mod
      ├── div_test.mod
      ├── dm_nv.mod
      ├── echo.mod
      ├── efifwsetup.mod
      ├── efi_gop.mod
      ├── efinet.mod
      ├── efi_uga.mod
      ├── ehci.mod
      ├── elf.mod
      ├── eval.mod
      ├── exfat.mod
      ├── exfctest.mod
      ├── ext2.mod
      ├── extcmd.mod
      ├── f2fs.mod
      ├── fat.mod
      ├── file.mod
      ├── fixvideo.mod
      ├── font.mod
      ├── fshelp.mod
      ├── fs.lst
      ├── functional_test.mod
      ├── gcry_arcfour.mod
      ├── gcry_blowfish.mod
      ├── gcry_camellia.mod
      ├── gcry_cast5.mod
      ├── gcry_crc.mod
      ├── gcry_des.mod
      ├── gcry_dsa.mod
      ├── gcry_idea.mod
      ├── gcry_md4.mod
      ├── gcry_md5.mod
      ├── gcry_rfc2268.mod
      ├── gcry_rijndael.mod
      ├── gcry_rmd160.mod
      ├── gcry_rsa.mod
      ├── gcry_seed.mod
      ├── gcry_serpent.mod
      ├── gcry_sha1.mod
      ├── gcry_sha256.mod
      ├── gcry_sha512.mod
      ├── gcry_tiger.mod
      ├── gcry_twofish.mod
      ├── gcry_whirlpool.mod
      ├── geli.mod
      ├── gettext.mod
      ├── gfxmenu.mod
      ├── gfxterm_background.mod
      ├── gfxterm_menu.mod
      ├── gfxterm.mod
      ├── gptsync.mod
      ├── grub.efi
      ├── gzio.mod
      ├── halt.mod
      ├── hashsum.mod
      ├── hdparm.mod
      ├── hello.mod
      ├── help.mod
      ├── hexdump.mod
      ├── hfs.mod
      ├── hfspluscomp.mod
      ├── hfsplus.mod
      ├── http.mod
      ├── iorw.mod
      ├── iso9660.mod
      ├── jfs.mod
      ├── jpeg.mod
      ├── keylayouts.mod
      ├── keystatus.mod
      ├── ldm.mod
      ├── legacycfg.mod
      ├── legacy_password_test.mod
      ├── linux16.mod
      ├── linuxefi.mod
      ├── linux.mod
      ├── loadbios.mod
      ├── load.cfg
      ├── loadenv.mod
      ├── loopback.mod
      ├── lsacpi.mod
      ├── lsefimmap.mod
      ├── lsefi.mod
      ├── lsefisystab.mod
      ├── lsmmap.mod
      ├── ls.mod
      ├── lspci.mod
      ├── lssal.mod
      ├── luks.mod
      ├── lvm.mod
      ├── lzopio.mod
      ├── macbless.mod
      ├── macho.mod
      ├── mdraid09_be.mod
      ├── mdraid09.mod
      ├── mdraid1x.mod
      ├── memdisk.mod
      ├── memrw.mod
      ├── minicmd.mod
      ├── minix2_be.mod
      ├── minix2.mod
      ├── minix3_be.mod
      ├── minix3.mod
      ├── minix_be.mod
      ├── minix.mod
      ├── mmap.mod
      ├── moddep.lst
      ├── modinfo.sh
      ├── morse.mod
      ├── mpi.mod
      ├── msdospart.mod
      ├── mul_test.mod
      ├── multiboot2.mod
      ├── multiboot.mod
      ├── nativedisk.mod
      ├── net.mod
      ├── newc.mod
      ├── nilfs2.mod
      ├── normal.mod
      ├── ntfscomp.mod
      ├── ntfs.mod
      ├── odc.mod
      ├── offsetio.mod
      ├── ohci.mod
      ├── part_acorn.mod
      ├── part_amiga.mod
      ├── part_apple.mod
      ├── part_bsd.mod
      ├── part_dfly.mod
      ├── part_dvh.mod
      ├── part_gpt.mod
      ├── partmap.lst
      ├── part_msdos.mod
      ├── part_plan.mod
      ├── part_sun.mod
      ├── part_sunpc.mod
      ├── parttool.lst
      ├── parttool.mod
      ├── password.mod
      ├── password_pbkdf2.mod
      ├── pata.mod
      ├── pbkdf2.mod
      ├── pbkdf2_test.mod
      ├── pcidump.mod
      ├── pgp.mod
      ├── play.mod
      ├── png.mod
      ├── priority_queue.mod
      ├── probe.mod
      ├── procfs.mod
      ├── progress.mod
      ├── raid5rec.mod
      ├── raid6rec.mod
      ├── random.mod
      ├── rdmsr.mod
      ├── read.mod
      ├── reboot.mod
      ├── regexp.mod
      ├── reiserfs.mod
      ├── relocator.mod
      ├── romfs.mod
      ├── scsi.mod
      ├── search_fs_file.mod
      ├── search_fs_uuid.mod
      ├── search_label.mod
      ├── search.mod
      ├── serial.mod
      ├── setjmp.mod
      ├── setjmp_test.mod
      ├── setpci.mod
      ├── sfs.mod
      ├── shift_test.mod
      ├── shim_lock.mod
      ├── signature_test.mod
      ├── sleep.mod
      ├── sleep_test.mod
      ├── smbios.mod
      ├── spkmodem.mod
      ├── squash4.mod
      ├── strtoull_test.mod
      ├── syslinuxcfg.mod
      ├── tar.mod
      ├── terminal.lst
      ├── terminal.mod
      ├── terminfo.mod
      ├── test_blockarg.mod
      ├── testload.mod
      ├── test.mod
      ├── testspeed.mod
      ├── tftp.mod
      ├── tga.mod
      ├── time.mod
      ├── tpm.mod
      ├── trig.mod
      ├── tr.mod
      ├── true.mod
      ├── udf.mod
      ├── ufs1_be.mod
      ├── ufs1.mod
      ├── ufs2.mod
      ├── uhci.mod
      ├── usb_keyboard.mod
      ├── usb.mod
      ├── usbms.mod
      ├── usbserial_common.mod
      ├── usbserial_ftdi.mod
      ├── usbserial_pl2303.mod
      ├── usbserial_usbdebug.mod
      ├── usbtest.mod
      ├── verifiers.mod
      ├── video_bochs.mod
      ├── video_cirrus.mod
      ├── video_colors.mod
      ├── video_fb.mod
      ├── videoinfo.mod
      ├── video.lst
      ├── video.mod
      ├── videotest_checksum.mod
      ├── videotest.mod
      ├── wrmsr.mod
      ├── xfs.mod
      ├── xnu.mod
      ├── xnu_uuid.mod
      ├── xnu_uuid_test.mod
      ├── xzio.mod
      ├── zfscrypt.mod
      ├── zfsinfo.mod
      ├── zfs.mod
      └── zstd.mod
      Last edited by GreyGeek; Apr 10, 2022, 05:08 PM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4

        Originally posted by GreyGeek View Post
        ...I had a choice between MBR and GPT...
        That suggests to me you did a grub-pc, BIOS install, on GPT using some kind of legacy compatibility mode, because with UEFI there is no choice, it must be GPT.

        Reading further...
        Grub-efi and grub-efi-bin are not installed on this notebook.
        Well, it is a BIOS install then. An unusual choice for any hardware from the last 10 years or so (if you're not oshunluvr).
        ... dictated that I should create an unformatted EFI partition and set its flag to "bios-flag"...
        I'd have thought those instructions are for a UEFI install... however, maybe the BIOS compatibility method you ended up with needs it.

        It's very easy to do this, because the isos these days are "hybrid" in that they can boot in BIOS mode or UEFI mode, and it's often very unclear which is which when you get a boot menu from the USB. It varies with the motherboard firmware. If you boot in BIOS mode, the installer can only do a BIOS install, and in UEFI mode a UEFI install.

        The BIOS mode boot may be getting clunky, as it's obsolescent. I've no idea whether that's the cause or even relevant to your original problem.

        Since the drive is GPT and there's an ESP, in theory it would be easy to change your boot to UEFI. I say "theory" because I've never done it and I can't try it out. F.ex. how to change ubuntu install from legacy to uefi.


        BTW,
        There is a TON of stuff in /boot/grub/x86_64-efi, but I have no clue as to what it all does. Probably nothing.
        They certainly do. If you grep the grub.cfg for "insmod" you'll see all the grub "modules", .mod files, that are used. They'd include btrfs.mod, all_video.mod, and part_gpt.mod at least.

        Another aside, when I saw your original post, I thought "grub being grub, again". I like to keep it on a tight leash, and don't let updates mess with my boot. If the boot gets screwed up, I want to be the one doing it.
        Regards, John Little

        Comment


          #5
          I have a similar (sort of) set-up:
          8M partition, type: bios-grub, unformatted.
          4G partition, type: swap.
          128M partition, type: esp, fat32, mounted on /boot/efi
          + separate root and home partitions.
          Legacy boot but GPT.
          I am not sure what Grub does with its own partition but I created it because it was recommended by the installer and .EFI files go to their own partitions, not to the bios-grub area. If I have to install a second distro, I create a separate /boot/efi and a separate / when doing a manual install. In automatic, installer does the exact same thing.

          Comment


            #6
            IF I "chose" a mixed install it was because the installer recommended it, and actually refused to continue without the EFI portion. I always do the manual partition mode instead of the automatic mode because BTRFS requires it.

            As far as when insmod is used grub.cfg shows that the kernel modules are loaded inside a "menuentry" section and without reference to the EFI section of /boot.
            Code:
            menuentry 'Neon GNU/Linux' --class neon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9bc19383-57
            db-4a32-938d-8466a133d94d' {
                   recordfail
                   load_video
                   gfxmode $linux_gfx_mode
                   insmod gzio
                   if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                   insmod part_gpt
                   insmod btrfs
                   set root='hd0,gpt3'
            ...
            Last edited by Snowhog; Apr 11, 2022, 06:24 AM.
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment

            Working...
            X