You are not logged in.

#1 2024-07-26 10:07:57

mosh
Member
Registered: 2007-05-06
Posts: 17

[SOLVED] pacman -Syu failure - DB corruption

Hello,

Just a newbie question about system update. pacman -Syu fails with multiple errors:

error: failed to commit transaction (conflicting files)
systemd: /usr/lib/systemd/system/bluetooth.target exists in filesystem
systemd: /usr/lib/systemd/system/boot-complete.target exists in filesystem
systemd: /usr/lib/systemd/system/console-getty.service exists in filesystem
systemd: /usr/lib/systemd/system/container-getty@.service exists in filesystem

All of them are related to systemd. pacman -Scc did not solve the problem. I couldn't find any topic regarding this problem on this forum. Any ideas how to solve this problem?

Thanks alot.

Last edited by mosh (2024-07-27 05:56:18)

Offline

#2 2024-07-26 10:25:57

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,368
Website

Re: [SOLVED] pacman -Syu failure - DB corruption

mosh wrote:

pacman -Scc did not solve the problem

...why would it?

Somehow your local db has lost its entry for systemd. Do you know what might have caused that? What does

ls /var/lib/pacman/local/systemd*

return?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2024-07-26 10:32:04

mosh
Member
Registered: 2007-05-06
Posts: 17

Re: [SOLVED] pacman -Syu failure - DB corruption

/var/lib/pacman/local/systemd-255.7-1:
desc  files  install  mtree

/var/lib/pacman/local/systemd-libs-255.7-1:
desc  files  mtree

/var/lib/pacman/local/systemd-sysvcompat-255.7-1:
desc  files  mtree

I have no idea what might cause it.

Offline

#4 2024-07-26 11:03:52

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,368
Website

Re: [SOLVED] pacman -Syu failure - DB corruption

What is the output of

stat /var/lib/pacman/local/systemd-255.7-1/files

Does that file have any content?

grep "usr/lib/systemd/system/[bc]" /var/lib/pacman/local/systemd-255.7-1/files

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#5 2024-07-26 11:21:31

mosh
Member
Registered: 2007-05-06
Posts: 17

Re: [SOLVED] pacman -Syu failure - DB corruption

stat /var/lib/pacman/local/systemd-255.7-1/files

results in:

 File: /var/lib/pacman/local/systemd-255.7-1/files
  Size: 63148           Blocks: 128        IO Block: 4096   regular file
Device: 8,2     Inode: 1197522     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-07-26 12:44:43.957657659 +0300
Modify: 2024-05-31 17:34:29.117788201 +0300
Change: 2024-05-31 17:34:29.117788201 +0300
 Birth: 2024-05-31 17:34:29.117788201 +0300

and

grep "usr/lib/systemd/system/[bc]" /var/lib/pacman/local/systemd-255.7-1/files

results in:

usr/lib/systemd/system/basic.target
usr/lib/systemd/system/blockdev@.target

Thank for the help.

Offline

#6 2024-07-26 11:54:43

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,368
Website

Re: [SOLVED] pacman -Syu failure - DB corruption

There is something very odd with that package. It doesn't seem that the db has been modified since the package was installed, but that grep should return

usr/lib/systemd/system/basic.target
usr/lib/systemd/system/blockdev@.target
usr/lib/systemd/system/bluetooth.target
usr/lib/systemd/system/boot-complete.target
usr/lib/systemd/system/console-getty.service
usr/lib/systemd/system/container-getty@.service
usr/lib/systemd/system/cryptsetup-pre.target
usr/lib/systemd/system/cryptsetup.target
usr/lib/systemd/system/ctrl-alt-del.target

What is the output of

pacman -Qi systemd

and

pacman-conf

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#7 2024-07-26 12:22:15

mosh
Member
Registered: 2007-05-06
Posts: 17

Re: [SOLVED] pacman -Syu failure - DB corruption

pacman -Qi systemd

results in:

Name            : systemd
Version         : 255.7-1
Description     : system and service manager
Architecture    : x86_64
URL             : https://www.github.com/systemd/systemd
Licenses        : LGPL-2.1-or-later  CC0-1.0  GPL-2.0-or-later  MIT-0
Groups          : None
Provides        : nss-myhostname  systemd-tools=255.7  udev=255.7
Depends On      : systemd-libs=255.7  acl  libacl.so=1-64  bash  cryptsetup  libcryptsetup.so=12-64  dbus  dbus-units  kbd  kmod  libkmod.so=2-64  hwdata
                  libcap  libcap.so=2-64  libgcrypt  libxcrypt  libcrypt.so=2-64  libidn2  lz4  pam  libelf  libseccomp  libseccomp.so=2-64  util-linux
                  libblkid.so=1-64  libmount.so=1-64  xz  pcre2  audit  libaudit.so=1-64  openssl  libcrypto.so=3-64  libssl.so=3-64
Optional Deps   : libmicrohttpd: systemd-journal-gatewayd and systemd-journal-remote
                  quota-tools: kernel-level quota management
                  systemd-sysvcompat: symlink package to provide sysvinit binaries [installed]
                  systemd-ukify: combine kernel and initrd into a signed Unified Kernel Image
                  polkit: allow administration as unprivileged user
                  curl: systemd-journal-upload, machinectl pull-tar and pull-raw [installed]
                  gnutls: systemd-journal-gatewayd and systemd-journal-remote [installed]
                  qrencode: show QR codes
                  iptables: firewall features [installed]
                  libbpf: support BPF programs [installed]
                  libpwquality: check password quality
                  libfido2: unlocking LUKS2 volumes with FIDO2 token
                  libp11-kit: support PKCS#11 [installed]
                  tpm2-tss: unlocking LUKS2 volumes with TPM2 [installed]
Required By     : base  mkinitcpio  systemd-sysvcompat  transmission-cli
Optional For    : None
Conflicts With  : nss-myhostname  systemd-tools  udev
Replaces        : nss-myhostname  systemd-tools  udev
Installed Size  : 30.96 MiB
Packager        : Christian Hesse <eworm@archlinux.org>
Build Date      : Mon 27 May 2024 06:19:54 PM IDT
Install Date    : Fri 31 May 2024 05:34:29 PM IDT
Install Reason  : Installed as a dependency for another package
Install Script  : Yes
Validated By    : Signature
pacman-conf

results in:

[options]
RootDir = /
DBPath = /var/lib/pacman/
CacheDir = /var/cache/pacman/pkg/
HookDir = /etc/pacman.d/hooks/
GPGDir = /etc/pacman.d/gnupg/
LogFile = /var/log/pacman.log
HoldPkg = pacman
HoldPkg = glibc
Architecture = x86_64
Color
CheckSpace
ParallelDownloads = 5
CleanMethod = KeepInstalled
SigLevel = PackageRequired
SigLevel = PackageTrustedOnly
SigLevel = DatabaseOptional
SigLevel = DatabaseTrustedOnly
LocalFileSigLevel = PackageOptional
LocalFileSigLevel = PackageTrustedOnly
[core]
Usage = All
Server = https://mirror.osbeck.com/archlinux/core/os/x86_64
Server = https://mirror.luzea.de/archlinux/core/os/x86_64
Server = https://archlinux.mailtunnel.eu/core/os/x86_64
Server = https://arch.mirror.zachlge.org/core/os/x86_64
Server = https://europe.mirror.pkgbuild.com/core/os/x86_64
Server = https://mirror.isoc.org.il/pub/archlinux/core/os/x86_64
Server = http://mirror.cyberbits.eu/archlinux/core/os/x86_64
Server = http://ftp.halifax.rwth-aachen.de/archlinux/core/os/x86_64
Server = http://mirror.luzea.de/archlinux/core/os/x86_64
Server = http://mirror.ubrco.de/archlinux/core/os/x86_64
Server = http://arch.jensgutermuth.de/core/os/x86_64
Server = http://ftp.myrveln.se/pub/linux/archlinux/core/os/x86_64
Server = http://mirror.moson.org/arch/core/os/x86_64
Server = http://tick-tack.mynetgear.com/archlinux/core/os/x86_64
Server = http://arch.mirror.constant.com/core/os/x86_64
Server = http://mirror.hackingand.coffee/arch/core/os/x86_64
Server = https://arch.jensgutermuth.de/core/os/x86_64
Server = http://archlinux.uk.mirror.allworldit.com/archlinux/core/os/x86_64
Server = http://mirror.lty.me/archlinux/core/os/x86_64
Server = https://archmirror.it/repos/core/os/x86_64
Server = http://mirrors.lug.mtu.edu/archlinux/core/os/x86_64
[extra]
Usage = All
Server = https://mirror.osbeck.com/archlinux/extra/os/x86_64
Server = https://mirror.luzea.de/archlinux/extra/os/x86_64
Server = https://archlinux.mailtunnel.eu/extra/os/x86_64
Server = https://arch.mirror.zachlge.org/extra/os/x86_64
Server = https://europe.mirror.pkgbuild.com/extra/os/x86_64
Server = https://mirror.isoc.org.il/pub/archlinux/extra/os/x86_64
Server = http://mirror.cyberbits.eu/archlinux/extra/os/x86_64
Server = http://ftp.halifax.rwth-aachen.de/archlinux/extra/os/x86_64
Server = http://mirror.luzea.de/archlinux/extra/os/x86_64
Server = http://mirror.ubrco.de/archlinux/extra/os/x86_64
Server = http://arch.jensgutermuth.de/extra/os/x86_64
Server = http://ftp.myrveln.se/pub/linux/archlinux/extra/os/x86_64
Server = http://mirror.moson.org/arch/extra/os/x86_64
Server = http://tick-tack.mynetgear.com/archlinux/extra/os/x86_64
Server = http://arch.mirror.constant.com/extra/os/x86_64
Server = http://mirror.hackingand.coffee/arch/extra/os/x86_64
Server = https://arch.jensgutermuth.de/extra/os/x86_64
Server = http://archlinux.uk.mirror.allworldit.com/archlinux/extra/os/x86_64
Server = http://mirror.lty.me/archlinux/extra/os/x86_64
Server = https://archmirror.it/repos/extra/os/x86_64
Server = http://mirrors.lug.mtu.edu/archlinux/extra/os/x86_64

Offline

#8 2024-07-26 14:43:25

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,368
Website

Re: [SOLVED] pacman -Syu failure - DB corruption

That all looks fine. I'm pretty stumped as to how you've ended up with a partial file listing for that package, especially since the 'missing' files are present on the filesystem. It could be the result of filesystem corruption, but I'd expect the whole file to become empty or unreadable in that case, not just some lines being missing. Have you had any hardware issues lately? Any filesystem errors during fsck? Any tell-tale signs of disk failure in S.M.A.R.T.?

If there's no obvious hardware or disk problems, then you *should* be able to resolve this by recreating the DB entry for that package using:

pacman -U --dbonly https://archive.archlinux.org/packages/s/systemd/systemd-255.7-1-x86_64.pkg.tar.zst

Once the db is repaired, you should be able to continue with the full system upgrade.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#9 2024-07-26 14:52:48

mosh
Member
Registered: 2007-05-06
Posts: 17

Re: [SOLVED] pacman -Syu failure - DB corruption

No file system error that I know of.

I recreated the DB with your entry and the problem is fixed.

Thank you very much for your quick and thorough respone!

Offline

#10 2024-07-26 21:59:48

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,368
Website

Re: [SOLVED] pacman -Syu failure - DB corruption

Please remember to mark your thread as solved.

https://wiki.archlinux.org/title/Genera … ow_to_post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

Board footer

Powered by FluxBB