You are not logged in.

#1 2018-10-29 22:44:26

Gede
Member
Registered: 2009-09-03
Posts: 28

[solved] pacman: "invalid or corrupted package"

Greetings. After my previous adventures with the filesystem (including packages) things appeared to work OK. I have updates the system but... a recent situation happened. Here is another chance of learning something.

I am currently seeing the following error message when trying to update the system:

:: Starting full system upgrade...
error: could not open file /var/lib/pacman/local/breeze-icons-5.50.0-1/desc: No such file or directory
resolving dependencies...
looking for conflicting packages...
error: could not open file /var/lib/pacman/local/breeze-5.13.5-1/files: No such file or directory
warning: could not fully load metadata for package breeze-5.13.5-1
error: failed to prepare transaction (invalid or corrupted package)

In truth, /var/lib/pacman/local/breeze-5.13.5-1/ contains only contains a file called "mtree". I expected this content to be part of the package file, but could not find them there.
Removing the files or installing the package anew did not work. It appears pacman requires those files to do anything with this package.

So, where does pacman get the content for those files and why are they not in the tar.xz? And how can I resolve this little problem I am facing? I did consider forcing a reinstalation to simply overwrite the files with themselves, but I decided to check here before doing anything I may regret.

Thank you.

Last edited by Gede (2018-10-30 20:23:55)

Offline

#2 2018-10-29 23:23:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,456
Website

Re: [solved] pacman: "invalid or corrupted package"

rm -r /var/lib/pacman/local/breeze-5.13.5-1/
pacman -S --force breeze

Offline

#3 2018-10-30 02:43:20

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [solved] pacman: "invalid or corrupted package"

To elaborate further, your database is currently corrupted and doesn't know what's in the breeze package you installed. The simple solution is to blow away the record so pacman can operate, then force-install the package and hope nothing went wrong.

Have you ever allowed pacman to be interrupted during an update?


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

Offline

#4 2018-10-30 20:23:20

Gede
Member
Registered: 2009-09-03
Posts: 28

Re: [solved] pacman: "invalid or corrupted package"

Thanks. That seems to have done the trick.

Have you ever allowed pacman to be interrupted during an update?

That seems like an extremely polite way of saying "pressing ^c". Certainly! But I also had a problem with the btrfs, where I think that I ran out of space for metadata but not for data. A few uncanny things happened.

By the way, where do those directories in /var/lib/pacman/local come from? From where does pacman get that information? I would like to know to learn bit by bit how things work.

I see three files for each package:
- desc seems to be extracted from the files in /var/lib/pacman/sync, which may be what pacman downloads from the server when we synchronize the database.
- files appears to be derived from the package file itself
- mtree looks more complex. It contains metadata for the files and directories, and those too appear present in the xz package file. Is it for sanity checks should the package itself be unavailable?

Last edited by Gede (2018-10-30 21:33:05)

Offline

#5 2018-10-31 17:08:02

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [solved] pacman: "invalid or corrupted package"

The "mtree" comes from the .pkg.tar.xz, and describes what the packaged files *should* be like. pacman -Qkk can check for issues based on this, and community/pacutils has programs that can try to fix these issues.

The "files" is just a manifest of the files that the package contains, built by pacman while extracting the package IIRC. Same with desc, except it contains all the metadata. While the desc file may seem like it comes from the sync database, it cannot come from there when installing a package via pacman -U. smile


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

Offline

#6 2018-10-31 23:02:01

Gede
Member
Registered: 2009-09-03
Posts: 28

Re: [solved] pacman: "invalid or corrupted package"

eschwartz wrote:

While the desc file may seem like it comes from the sync database, it cannot come from there when installing a package via pacman -U. smile

Uh! Good catch! Where does such metainformation come from in those cases? I could not find such a file in an arch package. I am curious!

Offline

#7 2018-10-31 23:41:30

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [solved] pacman: "invalid or corrupted package"

It is read from the .PKGINFO file, which is in a different format (key = value).

Yes, there have been thoughts about unifying the different formats we use for the same thing.


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

Offline

Board footer

Powered by FluxBB