You are not logged in.

#1 2024-11-10 13:14:07

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

[Solved] Power loss when upgrading kernel, unable to install packages

During a system update (pacman -Syu), during mkintcpio I get power loss. Now system is broken. While trying to reinstall anything I get

ldconfig:File /path/to/file(s) is empty, not checked

. If trying to reinstall linux it fails with error:

Error connecting: Could not connect: Connection refused

. I'm wondering should I run pacman with overwrite option https://wiki.archlinux.org/title/System … n_commands, even though is should be avoided. I'm out of ideas. I already tried bootable arch-chroot approach but this returns

file xyz exists in the system

Last edited by pag-r (2024-11-10 17:43:54)

Offline

#2 2024-11-10 14:36:03

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [Solved] Power loss when upgrading kernel, unable to install packages

I'm wondering should I run pacman with overwrite option

No.

https://wiki.archlinux.org/title/Pacman … ed_upgrade
You might have to use the pacman from the install iso, make sure it's not tooold™ or you get signature validation issues.

Check what's broken

pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Qkk | grep -v ', 0 altered files' | grep -v backup

Every package that shows up there with suspicious file deviations (some, esp. of config files are normal) needs to be re-installed.
Every package that shows up w/ broken or missing mtree needs to be installed --dbonly first, then proper

pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg --dbonly -Sy packages with broken mtrees
pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Sy all broken packages including the above ones

Offline

#3 2024-11-10 16:17:39

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

Re: [Solved] Power loss when upgrading kernel, unable to install packages

I tried with first mtree issued file and it still didn't helped

130 root@archiso ~ # grep mtree out.txt| head -1
btop: no mtree file
root@archiso ~ # pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg --dbonly -Sy btop
:: Synchronizing package databases...
 core is up to date
 extra is up to date
warning: btop-1.4.0-4 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) btop-1.4.0-4

Total Installed Size:  1.56 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                            [##########################################################################] 100%
(1/1) checking package integrity                                                                                          [##########################################################################] 100%
(1/1) loading package files                                                                                               [##########################################################################] 100%
:: Processing package changes...
ldconfig: File /usr/lib32/libharfbuzz-subset.so.0.61010.0 is empty, not checked.
ldconfig: File /usr/lib32/libharfbuzz-subset.so.0 is empty, not checked.
[...]
ldconfig: File /usr/lib/librubberband.so is empty, not checked.

Mounted root under /mnt

root@archiso ~ # mount | grep '/mnt'
/dev/mapper/myroot on /mnt type ext4 (rw,relatime)

Offline

#4 2024-11-10 16:19:45

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [Solved] Power loss when upgrading kernel, unable to install packages

That's ok, the first pass will not fix any files on disk and you'll have corrupted libraries on the ldconfig run.
Ignore those and continue w/ the second pass.

Offline

#5 2024-11-10 16:27:26

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

Re: [Solved] Power loss when upgrading kernel, unable to install packages

I've tried and result below

root@archiso ~ # pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Sy btop
:: Synchronizing package databases...
 core is up to date
 extra is up to date
warning: btop-1.4.0-4 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) btop-1.4.0-4

Total Installed Size:  1.56 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                            [##########################################################################] 100%
(1/1) checking package integrity                                                                                          [##########################################################################] 100%
(1/1) loading package files                                                                                               [##########################################################################] 100%
(1/1) checking for file conflicts                                                                                         [##########################################################################] 100%
(1/1) checking available disk space                                                                                       [##########################################################################] 100%
:: Processing package changes...
(1/1) reinstalling btop                                                                                                   [##########################################################################] 100%
ldconfig: File /usr/lib32/libharfbuzz-subset.so.0.61010.0 is empty, not checked.
[...]
ldconfig: File /usr/lib/libQt6QuickControls2Universal.so.6.8.0 is empty, not checked.
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Refreshing PackageKit...
Error connecting: Could not connect: No such file or directory
error: command failed to execute correctly
(3/4) Updating icon theme caches...
(4/4) Updating the desktop file MIME type cache...

Is that correct?

Offline

#6 2024-11-10 16:31:20

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [Solved] Power loss when upgrading kernel, unable to install packages

There are WAY more packages corrupted than just btop.
libharfbuzz-subset.so is from the harfbuzz package and libQt6QuickControls2Universal.so from qt6-declarative and then there's of course whatever you ellipsed.

The mtree corruptions are broken databases, causing the file collisions, but you need to re-install everything with suspicious package deviations and everything in /usr/lib and /usr/bin is super-suspicous.
In doubt rere-install all packages

Offline

#7 2024-11-10 16:45:41

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

Re: [Solved] Power loss when upgrading kernel, unable to install packages

I get it. So I should retry to install all of them in the row? I just thought it's a matter to install one-by-one. Never had such situation, so that's something new to me. When trying to re-reinstall it gives me

 root@archiso ~ # pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Qnq | pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -S -
warning: a52dec-0.8.0-2 is up to date -- reinstalling
[...]
warning: zxing-cpp-2.2.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
warning: dependency cycle detected:
warning: pam will be installed before its systemd-libs dependency
warning: dependency cycle detected:
warning: harfbuzz will be installed before its freetype2 dependency
warning: dependency cycle detected:
warning: mesa will be installed before its libglvnd dependency
warning: dependency cycle detected:
warning: nvidia-utils will be installed before its libglvnd dependency
warning: dependency cycle detected:
warning: eglexternalplatform will be installed before its libglvnd dependency
warning: dependency cycle detected:
warning: python-soupsieve will be installed before its python-beautifulsoup4 dependency
warning: dependency cycle detected:
warning: libcamera-ipa will be installed before its libcamera dependency
warning: dependency cycle detected:
warning: qt6-multimedia-ffmpeg will be installed before its qt6-multimedia dependency

Packages (1139) a52dec-0.8.0-2 [...] zxing-cpp-2.2.1-1

Total Installed Size:  9329.42 MiB
Net Upgrade Size:       556.30 MiB

:: Proceed with installation? [Y/n]
xorg-xbacklight: /mnt/usr/share/licenses/xorg-xbacklight/COPYING exists in filesystem
xorg-xbacklight: /mnt/usr/share/man/man1/xbacklight.1.gz exists in filesystem
Errors occurred, no packages were upgraded.

So I guess I completely broke my installation

Offline

#8 2024-11-10 16:49:29

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [Solved] Power loss when upgrading kernel, unable to install packages

So I guess I completely broke my installation

No. Relax, we get there wink

You've a conflict in (at least) xorg-xbacklight which you probably want to replace w/ acpilight at some point.
It'll likely also show up w/ a corrupted mtree?

In very doubt re-install all packages --dbonly first, then again w/o --dbonly

Offline

#9 2024-11-10 17:17:12

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

Re: [Solved] Power loss when upgrading kernel, unable to install packages

It went much more smooth now.
I guess I can skip multilib now
Output looks like this

mount -t proc proc /mnt/proc; mount --rbind /sys /mnt/sys; mount --rbind /dev /mnt/dev
pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Qnq | pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg --dbonly -Sy -
mount /dev/nvme0n1p1 /mnt/boot
pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Qnq | pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Sy -
[...]
:: Running post-transaction hooks...
( 1/33) Creating system user accounts...
( 2/33) Updating journal message catalog...
( 3/33) Reloading system manager configuration...
  Skipped: Running in chroot.
( 4/33) Reloading user manager configuration...
  Skipped: Running in chroot.
( 5/33) Updating udev hardware database...
( 6/33) Applying kernel sysctl settings...
  Skipped: Running in chroot.
( 7/33) Creating temporary files...
( 8/33) Reloading device manager configuration...
  Skipped: Running in chroot.
( 9/33) Arming ConditionNeedsUpdate...
(10/33) Updating the MIME type database...
(11/33) Rebuilding certificate stores...
(12/33) Updating module dependencies...
(13/33) Restarting cronie for libc upgrade...
Running in chroot, ignoring command 'try-restart'
(14/33) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img
==> Starting build: '6.11.6-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
  -> Running build hook: [lvm2]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: 'qat_420xx'
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
  -> Early uncompressed CPIO image generation successful
==> Initcpio image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: '6.11.6-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
==> WARNING: Possibly missing firmware for module: 'ast'
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'bfa'
  -> Running build hook: [lvm2]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: 'qat_420xx'
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-fallback.img'
  -> Early uncompressed CPIO image generation successful
==> Initcpio image generation successful
(15/33) Refreshing PackageKit...
Error connecting: Could not connect: No such file or directory
error: command failed to execute correctly
(16/33) Updating the appstream cache...
✔ Metadata cache was updated successfully.
(17/33) Reloading system bus configuration...
  Skipped: Running in chroot.
(18/33) Warn about old perl modules
(19/33) Updating fontconfig cache...
(20/33) Updating 32-bit fontconfig cache...
/usr/bin/fc-cache-32: error while loading shared libraries: /usr/lib32/libexpat.so.1: file too short
error: command failed to execute correctly
(21/33) Probing GDK-Pixbuf loader modules...
(22/33) Updating GIO module cache...
(23/33) Compiling GSettings XML schema files...
(24/33) Probing GTK2 input method modules...
(25/33) Probing GTK3 input method modules...
(26/33) Updating icon theme caches...
(27/33) Updating GTK4 module cache...
(28/33) Reloading GVFS config...
(29/33) Updating the info directory file...
(30/33) Updating the desktop file MIME type cache...
(31/33) Updating the vlc plugin cache...
(32/33) Updating Vim help tags...
(33/33) Updating X fontdir indices...

I'm not sure should I worry about PackageKit refreshing?

Offline

#10 2024-11-10 17:23:04

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [Solved] Power loss when upgrading kernel, unable to install packages

PackageShit won't work in this context, that's no concern
The system should boot and you can try to -Syu from there.

NB. The broken lib32/libexpat.so.1, you probably want to address that.

Offline

#11 2024-11-10 17:43:13

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 13

Re: [Solved] Power loss when upgrading kernel, unable to install packages

It finally worked. Thanks a lot.
As for the lib32 - I'll manage that.
Once again - thanks

Offline

Board footer

Powered by FluxBB