DietPi update from v10.1.2 to v10.5.2 Fails: grub-efi-amd64 error

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | CORE=10, SUB=1, RC=2, branch=master

    Distro version | trixie

  • Kernel version | Linux DietPi 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 GNU/Linux

  • Architecture | amd64

  • SBC model | Native PC (x86 64)

  • Power supply used | n/a

  • SD card used | n/a

Additional Information (if applicable)

  • Software title | mpd (controlled by Cantata v2.3.2 via network/ Win10 laptop
  • running dietpi-update, the process fails while processing grub-efi-amd64 (3x attempts give the same result)
  • Bug report ID | 4c07a9a3-a311-47db-ad3a-7c43a8ee020d

Steps to reproduce

  1. run dietpi-update (v10.1.2 to v10.5.2)

Expected behaviour

  • successful OS update to v10.5.2

Actual behaviour

Failure to complete process:

Extra details

Thankfully, the machine still boots into V10.1.2 and plays music (via mpd) as before the upgrade attempt.

Your help and guidance are much appreciated, thanks.

Grant

postinst scripts with unhandled muted errors are the best :smile:. It is a large one. The only practical way is to run it with -x flag, to see where it fails:

sudo sed -i '1a\set -x' /var/lib/dpkg/info/grub-efi-amd64.postinst
sudo dpkg --configure -a

This might produce a lot of output. In case just paste the last page or so.

And please run this via SSH, so you can copy&paste the output, instead of needing to do a photo, with most of the output lost outside of the screen.
EDIT: Ah, you are using SSH already. In that case, instead of doing photos, you can just select the output in PuTTY, which will copy it to clipboard. No photos or screenshots needed, much better readable etc.

Thanks for the quick reply. Running the commands you specified produces very little output:

root@DietPi:~# sudo sed -i '1a\set -x' /var/lib/dpkg/info/grub-efi-amd64.postinst
root@DietPi:~# sudo dpkg --configure -a
Setting up grub-efi-amd64 (2.12-9+deb13u2) ...
+ set -e
+ cached_available_ids=
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ _DEBCONF_IMPL=
++ '[' '' ']'
++ '[' -x /usr/share/debconf/frontend ']'
++ '[' '!' -h /usr/share/debconf/frontend ']'
++ _DEBCONF_IMPL=debconf
++ '[' '!' '' ']'
++ '[' debconf = cdebconf ']'
++ export PERL_DL_NONLAZY=1
++ PERL_DL_NONLAZY=1
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128
Errors were encountered while processing:
 grub-efi-amd64
root@DietPi:~#

That’s the whole of it - or did I neglect to do something else (noob that I am at this :laughing: )

Okay, so not that script fails but /usr/share/debconf/confmodule which it sources for defconf config dialogs. That script re-executes the postinst with a debconf wrapper, and it seems that wrapper fails internally, without producing any output :disappointed_face:. /usr/share/debconf/frontend is a perl script.

Please try those two things. To verify the script itself is not broken somehow:

perl -c /usr/share/debconf/frontend

Run the full wrapped postinst with debug flag:

perl -d /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

Again, minimal output from these runs:

root@DietPi:~# perl -c /usr/share/debconf/frontend
/usr/share/debconf/frontend syntax OK
root@DietPi:~#

and:

root@DietPi:~# perl -d /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
Can't locate perl5db.pl in @INC (@INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl).
BEGIN failed--compilation aborted.
root@DietPi:~#

Thanks for helping chase the ghosts :slightly_smiling_face: .

Ah, when using the debug flag -d, additional perl modules are needed. Um … but we cannot install them until grub-efi-amd64 has been configured … chicken&egg :roll_eyes:.

Try this, but be sure to copy&paste the commands, so that the first sed with line breaks is preserved correctly. Works fine here with PuTTY:

sed -i '1a\END {\
    warn "END: \\$?=$?\\n";\
}\
$SIG{__DIE__} = sub {\
    require Carp;\
    Carp::confess(@_);\
};' /usr/share/debconf/frontend
sed -i '/my $confmodule=make_confmodule/i\warn "before make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/$confmodule->owner/i\warn "after make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/i\warn "before communicate\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/a\warn "after communicate\\n";' /usr/share/debconf/frontend

perl /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

This adds inline debug info, so we hopefully can narrow down where it fails.

Anyway, I think we need to skip the GRUB postinst for now, to satisfy APT, reinstall perl-base as quick fix attempt (if the issue is in a damaged perl or its base modules), otherwise install perl debugging modules.

OK - copy/ paste/ run/ result:

root@DietPi:~# sed -i '1a\END {\
    warn "END: \\$?=$?\\n";\
}\
$SIG{__DIE__} = sub {\
    require Carp;\
    Carp::confess(@_);\
};' /usr/share/debconf/frontend
sed -i '/my $confmodule=make_confmodule/i\warn "before make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/$confmodule->owner/i\warn "after make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/i\warn "before communicate\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/a\warn "after communicate\\n";' /usr/share/debconf/frontend

perl /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
debconf: before make_confmodule

debconf: after make_confmodule

debconf: before communicate

debconf: after communicate

END: $?=128
root@DietPi:~#

Does this reveal anything new ?

As for your next step… how do I reinstall perl-base ?

Imagine a chimpanzee playing with a book of matches… Thanks :grin:

The core dump bit without any signal or exit code, that is weird. Something buggy with the perl of debconf modules. Tedious to debug manually, let’s solve the chicken&egg issue first:

mv /var/lib/dpkg/info/grub-efi-amd64.postinst /var/lib/dpkg/info/grub-efi-amd64.postinst.bak
dpkg --configure -a
apt install --reinstall perl-base debconf
apt update
apt upgrade
mv /var/lib/dpkg/info/grub-efi-amd64.postinst.bak /var/lib/dpkg/info/grub-efi-amd64.postinst
perl /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

If it still fails the same way:

apt install perl
perl -d /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

OK, reinstall perl-base…

root@DietPi:~# mv /var/lib/dpkg/info/grub-efi-amd64.postinst /var/lib/dpkg/info/grub-efi-amd64.postinst.bak
dpkg --configure -a
apt install --reinstall perl-base debconf
apt update
apt upgrade
mv /var/lib/dpkg/info/grub-efi-amd64.postinst.bak /var/lib/dpkg/info/grub-efi-amd64.postinst
perl /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
Setting up grub-efi-amd64 (2.12-9+deb13u2) ...
Summary:
  Upgrading: 0, Installing: 0, Reinstalling: 2, Removing: 0, Not Upgrading: 0
  Download size: 1787 kB
  Space needed: 0 B / 236 GB available

Get:1 https://deb.debian.org/debian trixie/main amd64 perl-base amd64 5.40.1-6 [1666 kB]
Get:2 https://deb.debian.org/debian trixie/main amd64 debconf all 1.5.91 [121 kB]
Fetched 1787 kB in 0s (4163 kB/s)
Preconfiguring packages ...
(Reading database ... 28352 files and directories currently installed.)
Preparing to unpack .../perl-base_5.40.1-6_amd64.deb ...
Unpacking perl-base (5.40.1-6) over (5.40.1-6) ...
Setting up perl-base (5.40.1-6) ...
(Reading database ... 28352 files and directories currently installed.)
Preparing to unpack .../debconf_1.5.91_all.deb ...
Unpacking debconf (1.5.91) over (1.5.91) ...
Setting up debconf (1.5.91) ...
Hit:1 https://deb.debian.org/debian trixie InRelease
Get:2 https://deb.debian.org/debian trixie-updates InRelease [47.3 kB]
Get:3 https://deb.debian.org/debian-security trixie-security InRelease [43.4 kB]
Get:4 https://deb.debian.org/debian trixie-backports InRelease [54.0 kB]
Get:5 https://deb.debian.org/debian trixie-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:6 https://deb.debian.org/debian trixie-backports/main amd64 Packages T-2026-08-04-0801.37-F-2026-08-02-0802.51.pdiff [6307 B]
Get:6 https://deb.debian.org/debian trixie-backports/main amd64 Packages T-2026-08-04-0801.37-F-2026-08-02-0802.51.pdiff [6307 B]
Get:7 https://dietpi.com/apt trixie InRelease [2140 B]
Get:8 https://dietpi.com/apt trixie/main amd64 Packages [6512 B]
Fetched 223 kB in 1s (285 kB/s)
All packages are up to date.
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
root@DietPi:~#

Rerun of prev script gave same result as above: END: $?=128

so install of perl:

root@DietPi:~# apt install perl
perl -d /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
Installing:
  perl

Installing dependencies:
  libgdbm-compat4t64  libgdbm6t64  libperl5.40  perl-modules-5.40

Suggested packages:
  gdbm-l10n  perl-doc  libterm-readline-gnu-perl  | libterm-readline-perl-perl  make  libtap-harness-archive-perl

Summary:
  Upgrading: 0, Installing: 5, Removing: 0, Not Upgrading: 0
  Download size: 7753 kB
  Space needed: 51.6 MB / 236 GB available

Continue? [Y/n] y
Get:1 https://deb.debian.org/debian trixie/main amd64 perl-modules-5.40 all 5.40.1-6 [3019 kB]
Get:2 https://deb.debian.org/debian trixie/main amd64 libgdbm6t64 amd64 1.24-2 [75.2 kB]
Get:3 https://deb.debian.org/debian trixie/main amd64 libgdbm-compat4t64 amd64 1.24-2 [50.3 kB]
Get:4 https://deb.debian.org/debian trixie/main amd64 libperl5.40 amd64 5.40.1-6 [4341 kB]
Get:5 https://deb.debian.org/debian trixie/main amd64 perl amd64 5.40.1-6 [267 kB]
Fetched 7753 kB in 1s (9652 kB/s)
Selecting previously unselected package perl-modules-5.40.
(Reading database ... 28352 files and directories currently installed.)
Preparing to unpack .../perl-modules-5.40_5.40.1-6_all.deb ...
Unpacking perl-modules-5.40 (5.40.1-6) ...
Selecting previously unselected package libgdbm6t64:amd64.
Preparing to unpack .../libgdbm6t64_1.24-2_amd64.deb ...
Unpacking libgdbm6t64:amd64 (1.24-2) ...
Selecting previously unselected package libgdbm-compat4t64:amd64.
Preparing to unpack .../libgdbm-compat4t64_1.24-2_amd64.deb ...
Unpacking libgdbm-compat4t64:amd64 (1.24-2) ...
Selecting previously unselected package libperl5.40:amd64.
Preparing to unpack .../libperl5.40_5.40.1-6_amd64.deb ...
Unpacking libperl5.40:amd64 (5.40.1-6) ...
Selecting previously unselected package perl.
Preparing to unpack .../perl_5.40.1-6_amd64.deb ...
Unpacking perl (5.40.1-6) ...
Setting up libgdbm6t64:amd64 (1.24-2) ...
Setting up libgdbm-compat4t64:amd64 (1.24-2) ...
Setting up perl-modules-5.40 (5.40.1-6) ...
Setting up libperl5.40:amd64 (5.40.1-6) ...
Setting up perl (5.40.1-6) ...
Processing triggers for libc-bin (2.41-12+deb13u3) ...

Loading DB routines from perl5db.pl version 1.80
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(/usr/share/debconf/frontend:8):
8:      };
  DB<1>

…at which point not sure of next thing to do, so I dropped the sed string in…

  DB<2> root@DietPi:~# sed -i '1a\END {\
    warn "END: \\$?=$?\\n";\
}\
$SIG{__DIE__} = sub {\
    require Carp;\
    Carp::confess(@_);\
};' /usr/share/debconf/frontend
sed -i '/my $confmodule=make_confmodule/i\warn "before make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/$confmodule->owner/i\warn "after make_confmodule\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/i\warn "before communicate\\n";' /usr/share/debconf/frontend
sed -i '/1 while ($confmodule->communicate)/a\warn "after communicate\\n";' /usr/share/debconf/frontend

perl /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
  cont:   cont:   cont:   cont:   cont:   cont: Array found where operator expected (Missing operator before "@DietPi"?) at (eval 18)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "root@DietPi"
 at (eval 18)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
root@DietPi:~# sed -i \'1a\\END {
    warn "END: \\\\$?=$?\\\\n";
}
$SIG{__DIE__} = sub {
    require Carp;
    Carp::confess(@_);
};\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 18)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "root@DietPi"
Execution of (eval 18)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 18)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
root@DietPi:~# sed -i \'1a\\END {
    warn "END: \\\\$?=$?\\\\n";
}
$SIG{__DIE__} = sub {
    require Carp;
    Carp::confess(@_);
};\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<3> String found where operator expected (Do you need to predeclare "i"?) at (eval 19)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/my $confmodule=make_confmodule/i\warn "before make_confmodule\\n";'"
 at (eval 19)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/my $confmodule=make_confmodule/i\\warn "before make_confmodule\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 19)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/my $confmodule=make_confmodule/i\warn "before make_confmodule\\n";'"
Execution of (eval 19)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 19)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/my $confmodule=make_confmodule/i\\warn "before make_confmodule\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<4> String found where operator expected (Do you need to predeclare "i"?) at (eval 20)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/$confmodule->owner/i\warn "after make_confmodule\\n";'"
 at (eval 20)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/$confmodule->owner/i\\warn "after make_confmodule\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 20)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/$confmodule->owner/i\warn "after make_confmodule\\n";'"
Execution of (eval 20)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 20)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/$confmodule->owner/i\\warn "after make_confmodule\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<5> String found where operator expected (Do you need to predeclare "i"?) at (eval 21)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/1 while ($confmodule->communicate)/i\warn "before communicate\\n";'"
 at (eval 21)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/1 while ($confmodule->communicate)/i\\warn "before communicate\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 21)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/1 while ($confmodule->communicate)/i\warn "before communicate\\n";'"
Execution of (eval 21)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 21)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/1 while ($confmodule->communicate)/i\\warn "before communicate\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<6> String found where operator expected (Do you need to predeclare "i"?) at (eval 22)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/1 while ($confmodule->communicate)/a\warn "after communicate\\n";'"
 at (eval 22)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/1 while ($confmodule->communicate)/a\\warn "after communicate\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 22)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "i '/1 while ($confmodule->communicate)/a\warn "after communicate\\n";'"
Execution of (eval 22)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 22)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
sed -i \'/1 while ($confmodule->communicate)/a\\warn "after communicate\\\\n";\' /usr/share/debconf/frontend;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<7>
  DB<7> Illegal division by zero at (eval 24)[/usr/share/perl/5.40/perl5db.pl:742] line 2.

  DB<8> debconf: before make_confmodule

debconf: after make_confmodule

debconf: before communicate

debconf: after communicate

END: $?=128
root@DietPi:~#Bareword found where operator expected (Do you need to predeclare "before"?) at (eval 25)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "before make_confmodule"
 at (eval 25)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
debconf: before make_confmodule;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 25)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "before make_confmodule"
Execution of (eval 25)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 25)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
debconf: before make_confmodule;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<9>
  DB<9> Bareword found where operator expected (Do you need to predeclare "after"?) at (eval 27)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "after make_confmodule"
 at (eval 27)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
debconf: after make_confmodule;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8
syntax error at (eval 27)[/usr/share/perl/5.40/perl5db.pl:742] line 2, near "after make_confmodule"
Execution of (eval 27)[/usr/share/perl/5.40/perl5db.pl:742] aborted due to compilation errors.
 at (eval 27)[/usr/share/perl/5.40/perl5db.pl:742] line 2.
        eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
debconf: after make_confmodule;
' called at /usr/share/perl/5.40/perl5db.pl line 742
        DB::eval called at /usr/share/perl/5.40/perl5db.pl line 3444
        DB::DB called at /usr/share/debconf/frontend line 8

  DB<10>
  DB<10> Can't locate object method "before" via package "communicate" (perhaps you forgot to load "communicate"?) at (eval 29)[/usr/share/perl/5.40/perl5db.pl:742] line 2.

  DB<11>
  DB<11> Can't locate object method "after" via package "communicate" (perhaps you forgot to load "communicate"?) at (eval 31)[/usr/share/perl/5.40/perl5db.pl:742] line 2.

  DB<12>
  DB<12>
  DB<13> q
END: $?=128
 at /usr/share/debconf/frontend line 3.
        main::END() called at /usr/share/debconf/frontend line 0
        eval {...} called at /usr/share/debconf/frontend line 0
root@DietPi:~#

Does this explain anything about the issue ? Thanks again…

You were inside a perl debug console, not in the shell, the the sed commands do not work but were invalid syntax. Also, they are not needed anymore now that we have perl debug tools.

Please do this:

perl -d /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

Then, within the debug console, enter t (to enable tracing), then c, to continue the script execution. When it finished processing, enter q to exit the debugger.

OK, saved log from PuTTY session: PuTTY log 2026-08-04 18h04m01s

Thanks for re-direction :wink: .

The perl script fails when it calls grub-efi-amd64.config, which exits unexpectedly, so that perl receives a SIGPIPE, which causes that 128 core dump without real exit code.

So we need to debug that one, which luckily is a shell script:

sed -i '1a\set -x' /var/lib/dpkg/info/grub-efi-amd64.config
/var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9

test result:

root@DietPi:~# sed -i '1a\set -x' /var/lib/dpkg/info/grub-efi-amd64.config
/var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
+ set -e
+ cached_available_ids=
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ _DEBCONF_IMPL=
++ '[' '' ']'
++ '[' -x /usr/share/debconf/frontend ']'
++ '[' '!' -h /usr/share/debconf/frontend ']'
++ _DEBCONF_IMPL=debconf
++ '[' '!' '' ']'
++ '[' debconf = cdebconf ']'
++ export PERL_DL_NONLAZY=1
++ PERL_DL_NONLAZY=1
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/grub-efi-amd64.postinst configure 2.12-9
debconf: before make_confmodule

debconf: after make_confmodule

debconf: before communicate

+ set -e
+ dpkg --print-architecture
+ . /usr/share/debconf/confmodule
+ _DEBCONF_IMPL=
+ [  ]
+ [ -x /usr/share/debconf/frontend ]
+ [ ! -h /usr/share/debconf/frontend ]
+ _DEBCONF_IMPL=debconf
+ [ ! 1 ]
+ [ -z  ]
+ exec
+ [ debconf = cdebconf ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ DEBCONF_OLD_FD_BASE=4
+ export DEBCONF_OLD_FD_BASE
+ priority=medium
+ [ -e /etc/default/grub ]
+ . /etc/default/grub
+ GRUB_DEFAULT=0
+ GRUB_TIMEOUT=0
+ . /etc/os-release
+ PRETTY_NAME=Debian GNU/Linux 13 (trixie)
+ NAME=Debian GNU/Linux
+ VERSION_ID=13
+ VERSION=13 (trixie)
+ VERSION_CODENAME=trixie
+ DEBIAN_VERSION_FULL=13.6
+ ID=debian
+ HOME_URL=https://www.debian.org/
+ SUPPORT_URL=https://www.debian.org/support
+ BUG_REPORT_URL=https://bugs.debian.org/
+ echo Debian GNU/Linux
+ GRUB_DISTRIBUTOR=Debian GNU/Linux
+ GRUB_CMDLINE_LINUX_DEFAULT=consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ GRUB_CMDLINE_LINUX=net.ifnames=0
+ [ set = set ]
+ db_set grub2/linux_cmdline net.ifnames=0
+ _db_cmd SET grub2/linux_cmdline net.ifnames=0
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n SET grub2/linux_cmdline net.ifnames=0
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=value set
+ local _db_status=0
+ return 0
+ [ set = set ]
+ db_set grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ _db_cmd SET grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ local _db_internal_IFS=

+ IFS=
+ printf %s\n SET grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=value set
+ local _db_status=0
+ return 0
+ [  = set ]
+ db_input medium grub2/linux_cmdline
+ _db_cmd INPUT medium grub2/linux_cmdline
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT medium grub2/linux_cmdline
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=20 Bad line "" received from confmodule.
+ local _db_status=20
+ return 20
+ true
+ db_input medium grub2/linux_cmdline_default
+ _db_cmd INPUT medium grub2/linux_cmdline_default
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT medium grub2/linux_cmdline_default
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/enable_os_prober
+ _db_cmd INPUT low grub2/enable_os_prober
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/enable_os_prober
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/force_efi_extra_removable
+ _db_cmd INPUT low grub2/force_efi_extra_removable
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/force_efi_extra_removable
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/update_nvram
+ _db_cmd INPUT low grub2/update_nvram
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/update_nvram
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_go
+ _db_cmd GO
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n GO
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
debconf: after communicate

END: $?=128
root@DietPi:~#

Next step ?

Hmm, the config shell script exits as expected. Leaves the question where the SIGPIPE was coming from. Reminds me to keep things simple in own scripts, instead of nesting shell and perl in such a complex way … Alone the fact that the perl -d output contains 235,000 lines :see_no_evil_monkey:.

The fact that debconf: after communicate is still returns btw means that /usr/share/debconf/frontend was not replaced with the original version, or did you run the sed commands from a shell as well again? Please reinstall the debconf package once more, and verify that the edits are gone:

apt install --reinstall debconf
sync
grep warn /usr/share/debconf/frontend

If so, this hopefully means all debconf scripts were really replaced now. Then try the manual configuration once more, so we rule out it does not fail because of some stale damage in debconf. Using the dpkg-reconfigure command, to rule out that the manual postinst call does not somehow cause issues. dpkg-reconfigure is explicitly meant to be called manually:

dpkg-reconfigure -f noninteractive grub-efi-amd64

Uh-oh, is this condition a show stopper ?

root@DietPi:~# apt install --reinstall debconf
sync
grep warn /usr/share/debconf/frontend
Summary:
  Upgrading: 0, Installing: 0, Reinstalling: 1, Removing: 0, Not Upgrading: 0
  Download size: 121 kB
  Space needed: 0 B / 236 GB available

Get:1 https://deb.debian.org/debian trixie/main amd64 debconf all 1.5.91 [121 kB]
Fetched 121 kB in 0s (1024 kB/s)
Preconfiguring packages ...
(Reading database ... 30516 files and directories currently installed.)
Preparing to unpack .../debconf_1.5.91_all.deb ...
Unpacking debconf (1.5.91) over (1.5.91) ...
Setting up debconf (1.5.91) ...
use warnings;
                warn "PERL_DL_NONLAZY is not set, if debconf is running from a preinst script, this is not safe";
root@DietPi:~#

No that’s all fine, the last two lines are the expected lines matching “warn” from the grep command. So the original /usr/share/debconf/frontend is now restored.

Alright, thanks for quick confirmation. Next…

root@DietPi:~# dpkg-reconfigure -f noninteractive grub-efi-amd64
+ set -e
+ dpkg --print-architecture
+ . /usr/share/debconf/confmodule
+ _DEBCONF_IMPL=
+ [  ]
+ [ -x /usr/share/debconf/frontend ]
+ [ ! -h /usr/share/debconf/frontend ]
+ _DEBCONF_IMPL=debconf
+ [ ! 1 ]
+ [ -z  ]
+ exec
+ [ debconf = cdebconf ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ DEBCONF_OLD_FD_BASE=4
+ export DEBCONF_OLD_FD_BASE
+ priority=medium
+ [ -e /etc/default/grub ]
+ . /etc/default/grub
+ GRUB_DEFAULT=0
+ GRUB_TIMEOUT=0
+ . /etc/os-release
+ PRETTY_NAME=Debian GNU/Linux 13 (trixie)
+ NAME=Debian GNU/Linux
+ VERSION_ID=13
+ VERSION=13 (trixie)
+ VERSION_CODENAME=trixie
+ DEBIAN_VERSION_FULL=13.6
+ ID=debian
+ HOME_URL=https://www.debian.org/
+ SUPPORT_URL=https://www.debian.org/support
+ BUG_REPORT_URL=https://bugs.debian.org/
+ echo Debian GNU/Linux
+ GRUB_DISTRIBUTOR=Debian GNU/Linux
+ GRUB_CMDLINE_LINUX_DEFAULT=consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ GRUB_CMDLINE_LINUX=net.ifnames=0
+ [ set = set ]
+ db_set grub2/linux_cmdline net.ifnames=0
+ _db_cmd SET grub2/linux_cmdline net.ifnames=0
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n SET grub2/linux_cmdline net.ifnames=0
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=value set
+ local _db_status=0
+ return 0
+ [ set = set ]
+ db_set grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ _db_cmd SET grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ local _db_internal_IFS=

+ IFS=
+ printf %s\n SET grub2/linux_cmdline_default consoleblank=0 amd_pstate.shared_mem=1 mitigations=off elevator=none tsc=perfect quiet irqaffinity=0 nosoftlockup nmi_watchdog=0 nohz=on isolcpus=nohz,domain,1-7 nohz_full=1-7 rcu_nocbs=1-7 no_balance_cores=1-7

+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=value set
+ local _db_status=0
+ return 0
+ [  = set ]
+ db_input medium grub2/linux_cmdline
+ _db_cmd INPUT medium grub2/linux_cmdline
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT medium grub2/linux_cmdline
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=20 Bad line "" received from confmodule.
+ local _db_status=20
+ return 20
+ true
+ db_input medium grub2/linux_cmdline_default
+ _db_cmd INPUT medium grub2/linux_cmdline_default
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT medium grub2/linux_cmdline_default
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/enable_os_prober
+ _db_cmd INPUT low grub2/enable_os_prober
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/enable_os_prober
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/force_efi_extra_removable
+ _db_cmd INPUT low grub2/force_efi_extra_removable
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/force_efi_extra_removable
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_input low grub2/update_nvram
+ _db_cmd INPUT low grub2/update_nvram
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT low grub2/update_nvram
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
+ true
+ db_go
+ _db_cmd GO
+ local _db_internal_IFS=

+ IFS=
+ printf %s\n GO
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ local _db_status=30
+ return 30
root@DietPi:~#

I saw RET=20 Bad line "" received from confmodule. in amongst the output - is this the culprit ?

That Bad line "" is actually a good hint, I did not recognize that earlier. The shell script ignores it via || true, but probably the frontend perl script has issues processing that. The other db_input commands produce valid output, so something seems to be different with this template.

Can you check this:

grep -A5 -R 'grub2/linux_cmdline$' /var/cache/debconf /var/lib/dpkg/info/grub-efi-amd64.templates

Result:

root@DietPi:~# grep -A5 -R 'grub2/linux_cmdline$' /var/cache/debconf /var/lib/dpkg/info/grub-efi-amd64.templates
/var/cache/debconf/templates.dat:Name: grub2/linux_cmdline
/var/cache/debconf/templates.dat-Description: Linux command line:
/var/cache/debconf/templates.dat-Description-ast.utf-8: Linia comandos Linux:
/var/cache/debconf/templates.dat-Description-be.utf-8: Радок камандаў для ядра Linux:
/var/cache/debconf/templates.dat-Description-bg.utf-8: Команден ред на Линукс:
/var/cache/debconf/templates.dat-Description-ca.utf-8: Línia d'ordres de Linux:
--
/var/cache/debconf/templates.dat:Owners: grub2/linux_cmdline
/var/cache/debconf/templates.dat-
/var/cache/debconf/templates.dat-Name: grub2/linux_cmdline_default
/var/cache/debconf/templates.dat-Default: quiet
/var/cache/debconf/templates.dat-Description: Linux default command line:
/var/cache/debconf/templates.dat-Description-ar.utf-8: سطر أوامر لينكس الافتراضي:
--
/var/cache/debconf/config.dat:Name: grub2/linux_cmdline
/var/cache/debconf/config.dat:Template: grub2/linux_cmdline
/var/cache/debconf/config.dat-Value: net.ifnames=0
/var/cache/debconf/config.dat-Owners: grub-efi-amd64
/var/cache/debconf/config.dat-
/var/cache/debconf/config.dat-Name: grub2/linux_cmdline_default
/var/cache/debconf/config.dat-Template: grub2/linux_cmdline_default
--
/var/cache/debconf/templates.dat-old:Name: grub2/linux_cmdline
/var/cache/debconf/templates.dat-old-Description: Linux command line:
/var/cache/debconf/templates.dat-old-Description-ast.utf-8: Linia comandos Linux:
/var/cache/debconf/templates.dat-old-Description-be.utf-8: Радок камандаў для ядра Linux:
/var/cache/debconf/templates.dat-old-Description-bg.utf-8: Команден ред на Линукс:
/var/cache/debconf/templates.dat-old-Description-ca.utf-8: Línia d'ordres de Linux:
--
/var/cache/debconf/templates.dat-old:Owners: grub2/linux_cmdline
/var/cache/debconf/templates.dat-old-
/var/cache/debconf/templates.dat-old-Name: grub2/linux_cmdline_default
/var/cache/debconf/templates.dat-old-Default: quiet
/var/cache/debconf/templates.dat-old-Description: Linux default command line:
/var/cache/debconf/templates.dat-old-Description-ar.utf-8: سطر أوامر لينكس الافتراضي:
--
/var/cache/debconf/config.dat-old:Name: grub2/linux_cmdline
/var/cache/debconf/config.dat-old:Template: grub2/linux_cmdline
/var/cache/debconf/config.dat-old-Value: net.ifnames=0
/var/cache/debconf/config.dat-old-Owners: grub-efi-amd64
/var/cache/debconf/config.dat-old-
/var/cache/debconf/config.dat-old-Name: grub2/linux_cmdline_default
/var/cache/debconf/config.dat-old-Template: grub2/linux_cmdline_default
--
/var/lib/dpkg/info/grub-efi-amd64.templates:Template: grub2/linux_cmdline
/var/lib/dpkg/info/grub-efi-amd64.templates-Type: string
/var/lib/dpkg/info/grub-efi-amd64.templates-Description: Linux command line:
/var/lib/dpkg/info/grub-efi-amd64.templates- The following Linux command line was extracted from /etc/default/grub or the
/var/lib/dpkg/info/grub-efi-amd64.templates- `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct,
/var/lib/dpkg/info/grub-efi-amd64.templates- and modify it if necessary. The command line is allowed to be empty.
root@DietPi:~#

Hmm, that is identical to what I see on a test system, no broken character or so.

As I see the translations, which locale do you use?

locale

Though this cannot play a role, since dietpi-update internally enforces C.UTF-8 (to assure that any external command output is parsed correctly).

Did we already try to reinstall grub-efi-amd64 itself?

apt install --reinstall grub-efi-amd64