You are not logged in.

#1 2011-06-29 13:53:33

excl
Guest

pacman trashed a whole bunch of packages

I was doing a big upgrade of maybe 100 or so packages and my system froze hard while pacman was installing stuff.  Even alt-sysrq didn't work and there was nothing I could do other than a hard reset.  After reset it appears that every single package it was installing is now trashed in a bad state.  Why doesn't pacman keep the state of what's it doing so it can recover in situations like this?  apt remembers if it hasn't fully configured a package so you can easily do a "apt-get -f install" to make it continue where it left off.

So now I'm stuck with a bunch of broken packages ("short file" errors and such).  Force reinstalling each package works but I have no idea which packages are in a bad state.  As I try to use the system I find more and more broken packages.   Basically the whole system is hosed because I can't manually pick through and reinstall every broken package.  Is there any way I can tell which packages pacman was working on during the failure and get it to repair them?

#2 2011-06-29 14:00:17

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: pacman trashed a whole bunch of packages

Have you tried looking into /var/log/pacman.log?


This silver ladybug at line 28...

Offline

#3 2011-06-29 14:05:46

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: pacman trashed a whole bunch of packages

What about pacman -Syu ? or if that does not work, you can try passing the -f flag --- but try to avoid this as much as you can.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2011-06-29 14:27:08

excl
Guest

Re: pacman trashed a whole bunch of packages

"pacman -Syu" doesn't work because it thinks the packages were all installed even though it didn't finish.   It really should keep some sort of installation state for situations like this.

I looked through the log in /var/log/pacman.log.  I pulled out a list of all the packages it was upgrading and did a "pacman -Sf" on all of them.  Unfortunately this didn't work very well because a lot of them failed to install (presumably because of other packages it needs that are in a bad state).   This still leaves me with a bunch of zero length files (eg. ldconfig lists a whole slew of zero length libraries;  packages that were in the first failed upgrade).

After that "pacman -Sf" I did try another -Syu upgrade but that failed too.  Some regular errors like when I did the -Sf reinstall/upgrade and some of those "file existing in package" errors.  This is bringing back a lot of unpleasant memories from when I was an Arch user many years ago.

#5 2011-06-29 14:54:46

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: pacman trashed a whole bunch of packages

Firstly, if you think pacman should have any particular additional functionality, submit a proper feature request, preferably with a patch attached. Including stuff like that in a forum help request is pointless.

Secondly, please post the complete output from any failed pacman commands - paraphrased snippets like "failed to install", "regular errors" (whatever they are), and "file existing in package" are not helpful.

And about apt remembering "if it hasn't fully configured a package" - pacman installs only, the configuration is up to you.

Offline

#6 2011-06-29 15:02:54

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: pacman trashed a whole bunch of packages

Here's a sticky for the FILENAME exists in filesystem -- I am assuming that's what you mean by file exists in package error.

https://bbs.archlinux.org/viewtopic.php?id=56373


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2011-06-29 15:38:35

oz
Member
Registered: 2004-05-20
Posts: 102

Re: pacman trashed a whole bunch of packages

Ah, found my original account.  That excl account can be deleted.  I thought I had lost this one.  Anyway...

tomk wrote:

Firstly, if you think pacman should have any particular additional functionality, submit a proper feature request, preferably with a patch attached. Including stuff like that in a forum help request is pointless.

Well the reason I would post something like there here is in the hopes that someone would say "It already does!" and show me the error of my ways and what I need to do.  It's not pointless in the sense that I think I just may not know what I'm doing.

Secondly, please post the complete output from any failed pacman commands - paraphrased snippets like "failed to install", "regular errors" (whatever they are), and "file existing in package" are not helpful.

Well if the machine actually worked I could do that.  As it is now I have no easy way to post the logs from that machine.  Besides, I'm not really looking for help on those issues, my original request was to get help on getting pacman to fix all the stuff it left in an indeterminate state.  I know how to fix errors like "file existing in package" (although I do still dislike that this type of problem still exists).  The bunch of zero length files is my main concern.

And about apt remembering "if it hasn't fully configured a package" - pacman installs only, the configuration is up to you.

This isn't about the user configuration.  I'm referring to pacman installation procedure.  It goes through a series of steps something like: download, verify, extract, configure.  It failed before it finished all those steps and left those packages in a bad state.   At this point as far as pacman is concerned it thinks it finished everything when it in fact it didn't.

Inxsible wrote:

Here's a sticky for the FILENAME exists in filesystem -- I am assuming that's what you mean by file exists in package error.

Yeah sorry, I should have been more clear.  I know what the error is and how to fix it.   I just meant "that typical error that everyone knows about."  That's the reason why I didn't elaborate on the errors I was getting.

With that said, it doesn't sound like there is an easy fix for this.  I'll mess around with it some more and see what I can do.  I was just hoping to not have to put in this amount of work to get the system running again smile

Offline

#8 2011-06-29 16:35:16

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: pacman trashed a whole bunch of packages

You still didn't post any logfiles :-D

Offline

#9 2011-06-29 19:54:50

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pacman trashed a whole bunch of packages

Try pacman -Qk. Something like pacman -S $(pacman -Qk | grep '[^0] missing' | cut -d: -f1) should help you recover your system.

Last edited by schuay (2011-06-29 19:55:58)

Offline

#10 2011-06-30 06:23:45

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: pacman trashed a whole bunch of packages

schuay wrote:

Try pacman -Qk. Something like pacman -S $(pacman -Qk | grep '[^0] missing' | cut -d: -f1) should help you recover your system.

Does -Qk check only the presence of files, or also integrity of the package (by adding file sizes)?

Last edited by lolilolicon (2011-06-30 06:24:58)


This silver ladybug at line 28...

Offline

#11 2011-06-30 06:34:20

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: pacman trashed a whole bunch of packages

File presence only.

Offline

#12 2011-06-30 09:51:23

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: pacman trashed a whole bunch of packages

tomk wrote:

File presence only.

Right, right, that makes sense since (some (configuration)) files will be modified by user, after installation.
Pacman only stores in the local database, a %SIZE% (installed size) in desc, and md5sum values of backup files in files, %BACKUP% section, and nothing more about individual files... so -Sf combined with log is the apparent way to go.


This silver ladybug at line 28...

Offline

#13 2011-06-30 11:57:24

oz
Member
Registered: 2004-05-20
Posts: 102

Re: pacman trashed a whole bunch of packages

Thanks for the tip on -Qk but only two packages showed missing files so unfortunately that's not a fix.  The broken packages seem to have all their files, it's just many are zero length.  It may only be the libraries that are zero length, I'm not sure.

I'm going to do a "find -size 0" and then replace all the packages those files go with.  Still, I have to wonder what else is messed up since there were so many broken things.  A reinstall would have been easier (which is a really bad way to go about life smile).

Offline

#14 2011-06-30 13:23:21

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: pacman trashed a whole bunch of packages

Is there some reason you don't want to simply reinstall all the most recent packages listed in /var/log/pacman.log?

Offline

#15 2011-07-02 00:16:51

lukaszan
Member
Registered: 2011-05-05
Posts: 117

Re: pacman trashed a whole bunch of packages

tomk wrote:

Is there some reason you don't want to simply reinstall all the most recent packages listed in /var/log/pacman.log?

You should be able to that. Pacman doesn't test sanity of dependencies, just presence.
Besides, if you're saying other packages are broken why don't you just refresh them all?

Offline

#16 2011-07-05 13:43:35

d_dave
Member
Registered: 2008-04-02
Posts: 18

Re: pacman trashed a whole bunch of packages

It sounds to me that you had a filesystem error - not a pacman error.  The fact you were upgrading at the time suggests that the failure would be widespread and very hard to track down all the failures which is exactly what you are suggesting.  Pacman seems to handle upgrades very logically - only one package would be transient at the time of your journal hiccup but MANY files would be in hiatus from journal to backup journal.  I would recommend doing a thorough filesystem check then refreshing the entire system.

Offline

Board footer

Powered by FluxBB