Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bookworm fails (E: Sub-process /usr/bin/dpkg returned an error code (1)) #7209

Closed
1 task done
gioxx opened this issue Sep 3, 2024 · 8 comments
Closed
1 task done

Comments

@gioxx
Copy link

gioxx commented Sep 3, 2024

Creating a bug report/issue

  • I have searched the existing open and closed issues

Required Information

  • DietPi version
G_DIETPI_VERSION_CORE=9  
G_DIETPI_VERSION_SUB=7  
G_DIETPI_VERSION_RC=1  
G_GITBRANCH='master'  
G_GITOWNER='MichaIng'
  • Distro version | bullseye
  • Kernel version | Linux Pyxmox 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 GNU/Linux
  • SBC model | Virtual Machine (x86_64)

Additional Information (if applicable)

  • Reference code: 1cec4302-3604-4a19-b8c5-1104e6027d80

Steps to reproduce

VM on Proxmox. I am directly using the upgrade script via bash <(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.meta/dietpi-bookworm-upgrade')

Actual behaviour

 Setting up mariadb-common (1:10.11.6-0+deb12u1) ...
update-alternatives: error: alternative path /etc/mysql/mariadb.cnf doesn't exist
dpkg: error processing package mariadb-common (--configure):
 installed mariadb-common package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of libmariadb3:amd64:
 libmariadb3:amd64 depends on mariadb-common; however:
  Package mariadb-common is not configured yet.

dpkg: error processing package libmariadb3:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libmailutils9:amd64:
 libmailutils9:amd64 depends on libmariadb3 (>= 3.0.0); however:
  Package libmariadb3:amd64 is not configured yet.

dpkg: error processing package libmailutils9:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mailutils:
 mailutils depends on libmailutils9; however:
  Package libmailutils9:amd64 is not configured yet.

dpkg: error processing package mailutils (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-common
 libmariadb3:amd64
 libmailutils9:amd64
 mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)

In the meantime, I brought the machine back on the snapshot I had taken just before. I absolutely remain available to try again and do further testing with you.

@gioxx gioxx changed the title Upgrade to Bookworm fails Upgrade to Bookworm fails (E: Sub-process /usr/bin/dpkg returned an error code (1)) Sep 3, 2024
@MichaIng
Copy link
Owner

MichaIng commented Sep 3, 2024

update-alternatives: error: alternative path /etc/mysql/mariadb.cnf doesn't exist

So the postinst script expects /etc/mysql/mariadb.cnf to exist, but it does not. It should actually be shipped with the Bullseye as well as Bookworm version of the package. Can you check that right now on Bullseye?

ls -l /etc/mysql/mariadb.cnf
dpkg -S /etc/mysql/mariadb.cnf

@gioxx
Copy link
Author

gioxx commented Sep 4, 2024

Ehi @MichaIng, here we are, again 👋 😄

root@Pyxmox:~# ls -l /etc/mysql/mariadb.cnf
ls: cannot access '/etc/mysql/mariadb.cnf': No such file or directory
root@Pyxmox:~# dpkg -S /etc/mysql/mariadb.cnf
mariadb-common: /etc/mysql/mariadb.cnf

@gioxx
Copy link
Author

gioxx commented Oct 4, 2024

Ciao @MichaIng! 👋
Is there at all any news on this issue? Thanks!

@MichaIng
Copy link
Owner

MichaIng commented Oct 4, 2024

Sorry for the late reply. Please try to recover that file this way:

cd /tmp
apt download mariadb-common
dpkg -i --force-depends,confmiss mariadb-common*.deb
ls -l /etc/mysql/mariadb.cnf

Then apt upgrade, and re-run the script.

@gioxx
Copy link
Author

gioxx commented Oct 10, 2024

Ciao @MichaIng, don't worry, I'm responding late too! 😄
Unfortunately, the problem has now changed, I show below the output of the commands.

Get:1 https://deb.debian.org/debian-security bullseye-security/main amd64 mariadb-common all 1:10.5.26-0+deb11u2 [37.5 kB]
Fetched 37.5 kB in 0s (647 kB/s)
(Reading database ... 41294 files and directories currently installed.)
Preparing to unpack mariadb-common_1%3a10.5.26-0+deb11u2_all.deb ...
Unpacking mariadb-common (1:10.5.26-0+deb11u2) over (1:10.5.23-0+deb11u1) ...
Setting up mariadb-common (1:10.5.26-0+deb11u2) ...

Configuration file '/etc/mysql/mariadb.cnf', does not exist on system.
Installing new config file as you requested.
update-alternatives: warning: alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: forcing reinstallation of alternative /etc/mysql/mariadb.cnf because link group my.cnf is broken
-rw-r--r-- 1 root root 1126 Sep  8 00:07 /etc/mysql/mariadb.cnf
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  linux-image-5.10.0-32-amd64
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  linux-image-5.10.0-33-amd64
The following packages will be upgraded:
  e2fsprogs libcom-err2 libcups2 libexpat1 libexpat1-dev libext2fs2 libmariadb3 libnghttp2-14 libsqlite3-0 libss2 linux-image-amd64 linux-libc-dev logsave tailscale
14 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 89.2 MB of archives.
After this operation, 320 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://deb.debian.org/debian-security bullseye-security/main amd64 logsave amd64 1.46.2-2+deb11u1 [75.0 kB]
Get:2 https://deb.debian.org/debian-security bullseye-security/main amd64 libext2fs2 amd64 1.46.2-2+deb11u1 [257 kB]
Get:3 https://deb.debian.org/debian-security bullseye-security/main amd64 e2fsprogs amd64 1.46.2-2+deb11u1 [614 kB]
Get:4 https://deb.debian.org/debian-security bullseye-security/main amd64 libcom-err2 amd64 1.46.2-2+deb11u1 [74.3 kB]
Get:5 https://deb.debian.org/debian-security bullseye-security/main amd64 libcups2 amd64 2.3.3op2-3+deb11u9 [351 kB]
Get:6 https://deb.debian.org/debian-security bullseye-security/main amd64 libexpat1-dev amd64 2.2.10-2+deb11u6 [142 kB]
Get:7 https://deb.debian.org/debian-security bullseye-security/main amd64 libexpat1 amd64 2.2.10-2+deb11u6 [99.0 kB]
Get:8 https://deb.debian.org/debian-security bullseye-security/main amd64 libmariadb3 amd64 1:10.5.26-0+deb11u2 [177 kB]
Get:9 https://deb.debian.org/debian-security bullseye-security/main amd64 libnghttp2-14 amd64 1.43.0-1+deb11u2 [77.0 kB]
Get:10 https://deb.debian.org/debian-security bullseye-security/main amd64 libsqlite3-0 amd64 3.34.1-3+deb11u1 [797 kB]
Get:11 https://deb.debian.org/debian-security bullseye-security/main amd64 libss2 amd64 1.46.2-2+deb11u1 [78.9 kB]
Get:12 https://deb.debian.org/debian-security bullseye-security/main amd64 linux-image-5.10.0-33-amd64 amd64 5.10.226-1 [55.8 MB]
Get:13 https://pkgs.tailscale.com/stable/debian bullseye/main amd64 tailscale amd64 1.74.1 [28.9 MB]
Get:14 https://deb.debian.org/debian-security bullseye-security/main amd64 linux-image-amd64 amd64 5.10.226-1 [1484 B]
Get:15 https://deb.debian.org/debian-security bullseye-security/main amd64 linux-libc-dev amd64 5.10.226-1 [1770 kB]
Fetched 89.2 MB in 3s (25.7 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 41294 files and directories currently installed.)
Preparing to unpack .../logsave_1.46.2-2+deb11u1_amd64.deb ...
Unpacking logsave (1.46.2-2+deb11u1) over (1.46.2-2) ...
Preparing to unpack .../libext2fs2_1.46.2-2+deb11u1_amd64.deb ...
Unpacking libext2fs2:amd64 (1.46.2-2+deb11u1) over (1.46.2-2) ...
Setting up libext2fs2:amd64 (1.46.2-2+deb11u1) ...
(Reading database ... 41294 files and directories currently installed.)
Preparing to unpack .../e2fsprogs_1.46.2-2+deb11u1_amd64.deb ...
Unpacking e2fsprogs (1.46.2-2+deb11u1) over (1.46.2-2) ...
Preparing to unpack .../libcom-err2_1.46.2-2+deb11u1_amd64.deb ...
Unpacking libcom-err2:amd64 (1.46.2-2+deb11u1) over (1.46.2-2) ...
Setting up libcom-err2:amd64 (1.46.2-2+deb11u1) ...
(Reading database ... 41294 files and directories currently installed.)
Preparing to unpack .../00-libcups2_2.3.3op2-3+deb11u9_amd64.deb ...
Unpacking libcups2:amd64 (2.3.3op2-3+deb11u9) over (2.3.3op2-3+deb11u8) ...
Preparing to unpack .../01-libexpat1-dev_2.2.10-2+deb11u6_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.2.10-2+deb11u6) over (2.2.10-2+deb11u5) ...
Preparing to unpack .../02-libexpat1_2.2.10-2+deb11u6_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u6) over (2.2.10-2+deb11u5) ...
Preparing to unpack .../03-libmariadb3_1%3a10.5.26-0+deb11u2_amd64.deb ...
Unpacking libmariadb3:amd64 (1:10.5.26-0+deb11u2) over (1:10.5.23-0+deb11u1) ...
Preparing to unpack .../04-libnghttp2-14_1.43.0-1+deb11u2_amd64.deb ...
Unpacking libnghttp2-14:amd64 (1.43.0-1+deb11u2) over (1.43.0-1+deb11u1) ...
Preparing to unpack .../05-libsqlite3-0_3.34.1-3+deb11u1_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.34.1-3+deb11u1) over (3.34.1-3) ...
Preparing to unpack .../06-libss2_1.46.2-2+deb11u1_amd64.deb ...
Unpacking libss2:amd64 (1.46.2-2+deb11u1) over (1.46.2-2) ...
Selecting previously unselected package linux-image-5.10.0-33-amd64.
Preparing to unpack .../07-linux-image-5.10.0-33-amd64_5.10.226-1_amd64.deb ...
Unpacking linux-image-5.10.0-33-amd64 (5.10.226-1) ...
Preparing to unpack .../08-linux-image-amd64_5.10.226-1_amd64.deb ...
Unpacking linux-image-amd64 (5.10.226-1) over (5.10.223-1) ...
Preparing to unpack .../09-linux-libc-dev_5.10.226-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.10.226-1) over (5.10.223-1) ...
Preparing to unpack .../10-tailscale_1.74.1_amd64.deb ...
Unpacking tailscale (1.74.1) over (1.72.1) ...
Setting up libexpat1:amd64 (2.2.10-2+deb11u6) ...
Setting up linux-image-5.10.0-33-amd64 (5.10.226-1) ...
/etc/kernel/postinst.d/tiny-initramfs:
tiny-initramfs: Generating /boot/initrd.img-5.10.0-33-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-33-amd64
Found initrd image: /boot/initrd.img-5.10.0-33-amd64
Found linux image: /boot/vmlinuz-5.10.0-32-amd64
Found initrd image: /boot/initrd.img-5.10.0-32-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
done
Setting up libsqlite3-0:amd64 (3.34.1-3+deb11u1) ...
Setting up libnghttp2-14:amd64 (1.43.0-1+deb11u2) ...
Setting up linux-libc-dev:amd64 (5.10.226-1) ...
Setting up linux-image-amd64 (5.10.226-1) ...
Setting up libexpat1-dev:amd64 (2.2.10-2+deb11u6) ...
Setting up libss2:amd64 (1.46.2-2+deb11u1) ...
Setting up libmariadb3:amd64 (1:10.5.26-0+deb11u2) ...
Setting up logsave (1.46.2-2+deb11u1) ...
Setting up libcups2:amd64 (2.3.3op2-3+deb11u9) ...
Setting up tailscale (1.74.1) ...
Setting up e2fsprogs (1.46.2-2+deb11u1) ...
e2scrub_all.service is a disabled or a static unit not running, not starting it.
e2scrub_all.timer is a disabled or a static unit not running, not starting it.
e2scrub_reap.service is a disabled or a static unit not running, not starting it.
Processing triggers for libc-bin (2.31-13+deb11u11) ...
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp#
root@Pyxmox:/tmp# bash <(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.meta/dietpi-bookworm-upgrade')
[ INFO ] dietpi-bookworm-upgrade | Upgrading APT packages to latest versions provided by Debian Bullseye
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[ INFO ] dietpi-bookworm-upgrade | APT update, please wait...
Hit:1 https://deb.debian.org/debian bullseye InRelease
Get:2 https://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:3 https://cli.github.com/packages stable InRelease [3917 B]
Hit:4 https://deb.debian.org/debian-security bullseye-security InRelease
Get:5 https://deb.debian.org/debian bullseye-backports InRelease [49.0 kB]
Hit:6 https://dietpi.com/apt bullseye InRelease
Err:3 https://cli.github.com/packages stable InRelease
  The following signatures were invalid: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <[email protected]>
Get:7 https://pkgs.tailscale.com/stable/debian bullseye InRelease
Fetched 104 kB in 1s (185 kB/s)
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: The following signatures were invalid: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <[email protected]>
E: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <[email protected]>
E: Some index files failed to download. They have been ignored, or old ones used instead.
[FAILED] dietpi-bookworm-upgrade | APT update
 - Command: apt-get -y -eany update
[ INFO ] DietPi-BugReport | Generating informative command outputs, please wait...
[ INFO ] DietPi-BugReport | cp /tmp/G_EXEC_ERROR_REPORT G_EXEC_ERROR_REPORT, please wait...
[  OK  ] DietPi-BugReport | cp /tmp/G_EXEC_ERROR_REPORT G_EXEC_ERROR_REPORT
[  OK  ] DietPi-BugReport | Packing upload archive
[  OK  ] DietPi-BugReport | Sending bug report
[  OK  ] DietPi-BugReport | Your bug report has been successfully uploaded.
- Reference code: 1cec4302-3604-4a19-b8c5-1104e6027d80

@gioxx
Copy link
Author

gioxx commented Oct 10, 2024

I did not realize that the invalid GitHub CLI signature was responsible for the above. I corrected it (check cli/cli#9569 (comment)) and, after following your last suggestion, was able to upgrade to Bookworm successfully 😄 🥳

root@Pyxmox:~# echo $G_DISTRO_NAME $G_RASPBIAN
bookworm
root@Pyxmox:~# uname -a
Linux Pyxmox 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux

@Joulinar
Copy link
Collaborator

Ok means we can close the topic, right?

@gioxx
Copy link
Author

gioxx commented Oct 10, 2024

Right! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants