[Bug 2048953] [NEW] grub fails to add boot entries if python3-apt is missing

Dalton Durst 2048953 at bugs.launchpad.net
Thu Jan 11 00:57:34 UTC 2024


Public bug reported:

In mantic and noble, when update-grub is run without python3-apt
installed, the following output is generated:

    Sourcing file `/etc/default/grub'
    Generating grub configuration file ...
    Traceback (most recent call last):
    File "/usr/lib/grub/grub-sort-version", line 4, in <module>
        import apt_pkg
    ModuleNotFoundError: No module named 'apt_pkg'
    Traceback (most recent call last):
    File "/usr/lib/grub/grub-sort-version", line 4, in <module>
        import apt_pkg
    ModuleNotFoundError: No module named 'apt_pkg'
    Traceback (most recent call last):
    File "/usr/lib/grub/grub-sort-version", line 4, in <module>
        import apt_pkg
    ModuleNotFoundError: No module named 'apt_pkg'
    Adding boot menu entry for UEFI Firmware Settings ...
    done

When this occurs, no Linux boot options are added to the GRUB config.

grub-sort-version was added to the grub-common binary package in
2.12~rc1-10ubuntu2. It is a python script which sorts the kernel
versions via Debian rules using apt_pkg. The grub package was updated to
depend on python3 so this script could run. However, the script also
depends on python3-apt.

Either grub-sort-version should be changed not to depend on python3-apt
(or fail gracefully when it's missing) or python3-apt should be added to
the dependencies of grub-common.

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

** Package changed: grub (Ubuntu) => grub2 (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/2048953

Title:
  grub fails to add boot entries if python3-apt is missing

Status in grub2 package in Ubuntu:
  New

Bug description:
  In mantic and noble, when update-grub is run without python3-apt
  installed, the following output is generated:

      Sourcing file `/etc/default/grub'
      Generating grub configuration file ...
      Traceback (most recent call last):
      File "/usr/lib/grub/grub-sort-version", line 4, in <module>
          import apt_pkg
      ModuleNotFoundError: No module named 'apt_pkg'
      Traceback (most recent call last):
      File "/usr/lib/grub/grub-sort-version", line 4, in <module>
          import apt_pkg
      ModuleNotFoundError: No module named 'apt_pkg'
      Traceback (most recent call last):
      File "/usr/lib/grub/grub-sort-version", line 4, in <module>
          import apt_pkg
      ModuleNotFoundError: No module named 'apt_pkg'
      Adding boot menu entry for UEFI Firmware Settings ...
      done

  When this occurs, no Linux boot options are added to the GRUB config.

  grub-sort-version was added to the grub-common binary package in
  2.12~rc1-10ubuntu2. It is a python script which sorts the kernel
  versions via Debian rules using apt_pkg. The grub package was updated
  to depend on python3 so this script could run. However, the script
  also depends on python3-apt.

  Either grub-sort-version should be changed not to depend on
  python3-apt (or fail gracefully when it's missing) or python3-apt
  should be added to the dependencies of grub-common.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2048953/+subscriptions




More information about the foundations-bugs mailing list