You are not logged in.

#1 2018-12-11 13:21:37

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 154

[solved] failed to commit transaction (invalid or corrupted package)

So, I just ran an upgrade:

$ LANG=C sudo pacman -Syyu
:: Synchronizing package databases...
 core                                                                                                 132.7 KiB   829K/s 00:00 [#############################################################################] 100%
 extra                                                                                               1693.8 KiB   756K/s 00:02 [#############################################################################] 100%
 community                                                                                              4.7 MiB   754K/s 00:06 [#############################################################################] 100%
 multilib                                                                                             175.1 KiB   796K/s 00:00 [#############################################################################] 100%
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (24) ca-certificates-mozilla-3.40.1-1  cryptsetup-2.0.6-1  device-mapper-2.02.183-1  gcc-libs-8.2.1+20181127-1  gnutls-3.6.5-1  lib32-gcc-libs-8.2.1+20181127-1  lib32-libcups-2.2.10-1
              lib32-lm_sensors-3.5.0-2  lib32-mesa-18.2.6-1  lib32-nss-3.40.1-1  libcups-2.2.10-1  libgpg-error-1.33-1  linux-lts-4.14.87-1  lm_sensors-3.5.0-1  lvm2-2.02.183-1  mesa-18.2.6-1  nettle-3.4.1-1
              nginx-1.14.2-1  nss-3.40.1-1  pacman-mirrorlist-20181205-1  perl-5.28.1-1  python-idna-2.8-1  vim-8.1.0570-1  vim-runtime-8.1.0570-1

Total Installed Size:  493.25 MiB
Net Upgrade Size:        0.63 MiB

:: Proceed with installation? [Y/n] 
(24/24) checking keys in keyring                                                                                               [#############################################################################] 100%
(24/24) checking package integrity                                                                                             [#############################################################################] 100%
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

Which package is the problem. And why?
PS: Ran

pacman -Sc

and tried again. Same issue.
PPS: Ran

pacman -Sc

even once more and tried again. Fixed.
Probably caught the mirror while syncing?
Still strange, that no affected package was printed.

Last edited by schard (2018-12-11 13:27:04)

Offline

#2 2018-12-11 17:49:50

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,700

Re: [solved] failed to commit transaction (invalid or corrupted package)

I know this one! https://bugs.archlinux.org/task/39257

It's deeply magical, pacman thinks the file should exist but hasn't renamed it yet (or ever) and then it cannot find the file when it needs it. Compounding the problem is that because this is a technical bug in pacman rather than a legitimate error with the package, there is no sensible error message.

EDIT: Remembering further, I believe this one is in fact https://bugs.archlinux.org/task/43586 in which case this is fixed in git master...

The original bug I fingered was a different error message:
error: failed to commit transaction (wrong or NULL argument passed)

...

Side note: do not use pacman -Syyu as it can result in partial updates. I'm not sure why this is such popular advice on the internet, but it's exceedingly bad.

Last edited by eschwartz (2018-12-12 04:53:29)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-12-11 21:02:00

chr0mag
Member
From: Canada
Registered: 2017-02-02
Posts: 66

Re: [solved] failed to commit transaction (invalid or corrupted package)

eschwartz wrote:

Side note: do not use pacman -Syyu as it can result in partial updates.

How would forcing a package database refresh cause a partial upgrade?

Offline

#4 2018-12-11 22:49:14

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,103

Re: [solved] failed to commit transaction (invalid or corrupted package)

Because forcing a database refresh is only useful in a few situations, one of which is switching to older databases. If this is the case, you'll have newer packages installed than are in your database, and new installations will be the old version potentially built against older libs than you have. If you're going to do it, you need to add a second -u as well.

Offline

#5 2018-12-11 23:13:24

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,700

Re: [solved] failed to commit transaction (invalid or corrupted package)

chr0mag wrote:
eschwartz wrote:

Side note: do not use pacman -Syyu as it can result in partial updates.

How would forcing a package database refresh cause a partial upgrade?

What does "forcing" a package database refresh mean, when pacman always checks if the database needs to be refreshed, then refreshes it?

It means, that pacman should ignore the thing it uses to determine whether you or the mirror is newer.

It means that you say "I know the mirror is older, but I wanna download it anyway".

...

If you *know* the server is older, then you also know the packages are older. Downgrading the database, then installing old packages while keeping new packages that are already installed, is a state of being partially upgraded.

If you know the server is completely and utterly broken, then you switch mirrors, and you don't force downgrade. If the new mirror is working, then you'll know due to it syncing updates.

If you know that your own system is broken, because you e.g. -Syu while behind a captive portal for some terrible wifi network, then you also know that your database is currently overwritten by some html page. Which isn't much of a database, and pacman will rightly error when trying to utilize that. In this case, you can and should use -Syyu to fix the problem. (Captive portals will usually be dynamically generated and thus the timestamp will be much newer than the mirror database.)

If you know that your system is fine, but you also know that your mirror has just been switched to some historical date on the Arch Linux Archive, then you legitimately wish to downgrade the databases. Be sure to also use -Syyuu for the double -u which downgrades your packages so that your system is *actually* running on the historical snapshot.

...

Almost all actual uses of pacman -Syyu fall under category #5.

"I don't know what I'm doing, but I heard that if I use it twice then I'll be extra sure to get updates."

This is wrong, since you will be extra sure to get *downgrades* instead. And then your system breaks.

And eschwartz comes by and warns of the danger of Cargo cult programming and the benefits of slavishly obsessing over the manpage and subscribing to the development lists and hacking on the code in order to ensure you actually understand what you're doing and why you're doing it.

(Or at least the benefits of following his posts in order to look cool and find out all the dirty secrets.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2018-12-12 06:31:52

chr0mag
Member
From: Canada
Registered: 2017-02-02
Posts: 66

Re: [solved] failed to commit transaction (invalid or corrupted package)

eschwartz wrote:

Almost all actual uses of pacman -Syyu fall under category #5.

"I don't know what I'm doing, but I heard that if I use it twice then I'll be extra sure to get updates."

Yep, that was me up until reading this thread. Thanks for the comprehensive answers folks and apologies for jacking the thread.

Offline

#7 2018-12-12 08:43:40

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 154

Re: [solved] failed to commit transaction (invalid or corrupted package)

Thanks to all for your input.
Just to clarify, I usually don't upgrade using -yy but a single -y.
I just did that in this case because of the original error message that I got, thinking that maybe the package databases were broken thus forcing the re-download of them.

Offline

Board footer

Powered by FluxBB