package linux-image-6.5.0-1005-raspi 6.5.0-1005.7 failed to install/upgrade: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1

Bug #2039342 reported by KcrPL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This happened during the upgrade.

ProblemType: Package
DistroRelease: Ubuntu 23.10
Package: linux-image-6.5.0-1005-raspi 6.5.0-1005.7
ProcVersionSignature: Ubuntu 6.2.0-1014.16-raspi 6.2.16
Uname: Linux 6.2.0-1014-raspi aarch64
ApportVersion: 2.27.0-0ubuntu5
Architecture: arm64
CasperMD5CheckResult: unknown
CloudArchitecture: aarch64
CloudBuildName: server
CloudID: nocloud
CloudName: unknown
CloudPlatform: nocloud
CloudSerial:

CloudSubPlatform: config-disk (/dev/sdb1)
Date: Sat Oct 14 09:07:02 2023
ErrorMessage: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
ImageMediaBuild: 20210201.1
Python3Details: /usr/bin/python3.11, Python 3.11.6, python3-minimal, 3.11.4-5
PythonDetails: N/A
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions:
 dpkg 1.22.0ubuntu1
 apt 2.7.3
SourcePackage: initramfs-tools
Title: package linux-image-6.5.0-1005-raspi 6.5.0-1005.7 failed to install/upgrade: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
UpgradeStatus: Upgraded to mantic on 2023-10-14 (0 days ago)

Revision history for this message
KcrPL (kcrpl) wrote :
Revision history for this message
KcrPL (kcrpl) wrote :

As a temporary solution I have moved /usr/share/initramfs-tools/hooks/dhcpcd out of the folder and update-initramfs has succeeded.
After restarting, I'm on kernel 6.5.0 and I have access to the Internet.

Can I leave it like this or is there a way to fix this?

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The relevant dpkg terminal log says:

E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 1.

Sadly there is no error message explaining the exit code 1. Can you move /usr/share/initramfs-tools/hooks/dhcpcd back and add "set -x" (without the quotes) to the script and then run update-initramfs to get more log output?

sudo nano /usr/share/initramfs-tools/hooks/dhcpcd
sudo update-initramfs -u

Please attach the output to the bug report then.

Changed in initramfs-tools (Ubuntu):
status: New → Incomplete
Revision history for this message
KcrPL (kcrpl) wrote :
Download full text (5.4 KiB)

I have added "set -x" just under "set -e" in the script. Here are the following results:

kcrpl@raspberrypi-4-kcrpl:/usr/share/initramfs-tools/hooks$ sudo update-initramfs -u
+ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.5.0-1005-raspi
+ PREREQ=
+ prereqs
+ echo
+ exit 0
+ PREREQ=
+ . /usr/share/initramfs-tools/hook-functions
+ [ -x /usr/sbin/dhcpcd ]
+ copy_exec /usr/sbin/dhcpcd
+ local src target x nonoptlib ret
+ src=/usr/sbin/dhcpcd
+ target=/usr/sbin/dhcpcd
+ copy_file binary /usr/sbin/dhcpcd /usr/sbin/dhcpcd
+ local type src target link_target
+ type=binary
+ src=/usr/sbin/dhcpcd
+ target=/usr/sbin/dhcpcd
+ [ -f /usr/sbin/dhcpcd ]
+ [ -d /var/tmp/mkinitramfs_FoHhvu//usr/sbin/dhcpcd ]
+ [ -e /var/tmp/mkinitramfs_FoHhvu//usr/sbin/dhcpcd ]
+ mkdir -p /var/tmp/mkinitramfs_FoHhvu//usr/sbin
+ [ -h /usr/sbin/dhcpcd ]
+ [ n = y ]
+ cp -pP /usr/sbin/dhcpcd /var/tmp/mkinitramfs_FoHhvu//usr/sbin/dhcpcd
+ env --unset=LD_PRELOAD ldd /usr/sbin/dhcpcd
+ sed -e
                /\//!d;
                /linux-gate/d;
                /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
                s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/
+ echo /lib/aarch64-linux-gnu/libcrypto.so.3
+ sed -e s#/lib/\([^/]*/\)\?\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\1\3#
+ nonoptlib=/lib/aarch64-linux-gnu/libcrypto.so.3
+ echo /lib/aarch64-linux-gnu/libcrypto.so.3
+ sed -e s#-linux-gnu/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#-linux-gnu/\2#
+ nonoptlib=/lib/aarch64-linux-gnu/libcrypto.so.3
+ [ -e /lib/aarch64-linux-gnu/libcrypto.so.3 ]
+ x=/lib/aarch64-linux-gnu/libcrypto.so.3
+ copy_file binary /lib/aarch64-linux-gnu/libcrypto.so.3
+ local type src target link_target
+ type=binary
+ src=/lib/aarch64-linux-gnu/libcrypto.so.3
+ target=/lib/aarch64-linux-gnu/libcrypto.so.3
+ [ -f /lib/aarch64-linux-gnu/libcrypto.so.3 ]
+ [ -d /var/tmp/mkinitramfs_FoHhvu//lib/aarch64-linux-gnu/libcrypto.so.3 ]
+ target=/usr/lib/aarch64-linux-gnu/libcrypto.so.3
+ [ -e /var/tmp/mkinitramfs_FoHhvu//usr/lib/aarch64-linux-gnu/libcrypto.so.3 ]
+ return 1
+ ret=1
+ [ 1 = 1 ]
+ echo /lib/aarch64-linux-gnu/libc.so.6
+ sed -e s#/lib/\([^/]*/\)\?\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\1\3#
+ nonoptlib=/lib/aarch64-linux-gnu/libc.so.6
+ echo /lib/aarch64-linux-gnu/libc.so.6
+ sed -e s#-linux-gnu/\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#-linux-gnu/\2#
+ nonoptlib=/lib/aarch64-linux-gnu/libc.so.6
+ [ -e /lib/aarch64-linux-gnu/libc.so.6 ]
+ x=/lib/aarch64-linux-gnu/libc.so.6
+ copy_file binary /lib/aarch64-linux-gnu/libc.so.6
+ local type src target link_target
+ type=binary
+ src=/lib/aarch64-linux-gnu/libc.so.6
+ target=/lib/aarch64-linux-gnu/libc.so.6
+ [ -f /lib/aarch64-linux-gnu/libc.so.6 ]
+ [ -d /var/tmp/mkinitramfs_FoHhvu//lib/aarch64-linux-gnu/libc.so.6 ]
+ target=/usr/lib/aarch64-linux-gnu/libc.so.6
+ [ -e /var/tmp/mkinitramfs_FoHhvu//usr/lib/aarch64-linux-gnu/libc.so.6 ]
+ return 1
+ ret=1
+ [ 1 = 1 ]
+ echo /lib/ld-linux-aarch64.so.1
+ sed -e s#/lib/\([^/]*/\)\?\(tls\|i686\|sse2\|neon\|vfp\).*/\(lib.*\)#/lib/\1\3#
+ nonoptlib=/lib/ld-linux-aarch64.so.1
+ echo /lib/ld-linux-aarch64.so.1
+ sed -e s#-linux-gnu/\(tls\|i686\|sse2\|neon\|vfp\).*/\(li...

Read more...

Revision history for this message
Benjamin Drung (bdrung) wrote :

initramfs-tools only uses the dhcpcd binary from dhcpcd-base (not the dhcpcd service).

The relevant log lines from the output are:

+ copy_exec /usr/lib/dhcpcd/dhcpcd-run-hooks
+ local src target x nonoptlib ret
+ src=/usr/lib/dhcpcd/dhcpcd-run-hooks
+ target=/usr/lib/dhcpcd/dhcpcd-run-hooks
+ copy_file binary /usr/lib/dhcpcd/dhcpcd-run-hooks /usr/lib/dhcpcd/dhcpcd-run-hooks
+ local type src target link_target
+ type=binary
+ src=/usr/lib/dhcpcd/dhcpcd-run-hooks
+ target=/usr/lib/dhcpcd/dhcpcd-run-hooks
+ [ -f /usr/lib/dhcpcd/dhcpcd-run-hooks ]
+ return 2
+ return 1
E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 1.
update-initramfs: failed for /boot/initrd.img-6.5.0-1005-raspi with 1.

The test if /usr/lib/dhcpcd/dhcpcd-run-hooks exist fails. Is dhcpcd-base fully installed and /usr/lib/dhcpcd/dhcpcd-run-hooks present?

Revision history for this message
KcrPL (kcrpl) wrote :

 kcrpl@raspberrypi-4-kcrpl:~$ ls /usr/lib/dhcpcd/dhcpcd-run-hooks
 ls: cannot access '/usr/lib/dhcpcd/dhcpcd-run-hooks': No such file or directory

 kcrpl@raspberrypi-4-kcrpl:~$ sudo apt install --reinstall dhcpcd-base
 Reading package lists... Done
 Building dependency tree... Done
 Reading state information... Done
 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
 Need to get 208 kB of archives.
 After this operation, 0 B of additional disk space will be used.
 Get:1 http://ports.ubuntu.com/ubuntu-ports mantic/main arm64 dhcpcd-base arm64 1:10.0.2-3ubuntu3 [208 kB]
 Fetched 208 kB in 0s (580 kB/s)
 (Reading database ... 214263 files and directories currently installed.)
 Preparing to unpack .../dhcpcd-base_1%3a10.0.2-3ubuntu3_arm64.deb ...
 Unpacking dhcpcd-base (1:10.0.2-3ubuntu3) over (1:10.0.2-3ubuntu3) ...
 Setting up dhcpcd-base (1:10.0.2-3ubuntu3) ...
 Processing triggers for man-db (2.11.2-3) ...
 Scanning processes...
 Scanning processor microcode...
 Scanning linux images...

 Running kernel seems to be up-to-date.

 Failed to check for processor microcode upgrades.

 No services need to be restarted.

 No containers need to be restarted.

 No user sessions are running outdated binaries.

 No VM guests are running outdated hypervisor (qemu) binaries on this host.

 kcrpl@raspberrypi-4-kcrpl:~$ ls /usr/lib/dhcpcd/dhcpcd-run-hooks
 /usr/lib/dhcpcd/dhcpcd-run-hooks

 kcrpl@raspberrypi-4-kcrpl:~$ sudo update-initramfs -u
 (skipping log)

...it worked! This happened during the upgrade because before that everything worked correctly.

Thank you very much and have a great day!

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thanks for debugging. So closing this bug as invalid, because dhcpcd-base was not installed properly.

Changed in initramfs-tools (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.