You are not logged in.

#1 2015-03-09 19:54:26

yrral86
Member
Registered: 2014-10-22
Posts: 8

Error on upgrade

I'm not sure what happened (possibly a power outage during a previous upgrade), but whenever I try to upgrade any packages (or a system wide upgrade), every single package gives me this error:

error: failed to commit transaction (conflicting files)

followed by

/path/to/file exists in filesystem

for all files in each package (and directories along the path like /usr/share)

I could proceed by using --force (and I did once in the hope that it would resolve the issue), but it is frowned upon on the wiki (https://wiki.archlinux.org/index.php/pa … 9.22_error) and I'd rather not continue to use it for all upgrades from now until I reinstall.

Is there a way to recover from this?  If not, what is the danger of --force (I assume broken packages could stop on existing files)?  I'd rather avoid a reinstall, but if that is the only option, is there an easy way to just reinstall pacman and all my packages without losing all my config files and custom symlinks (I have / on an ssd and several system directories are symlinked to a raid array).

Offline

#2 2015-03-09 19:55:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Error on upgrade

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-03-09 20:03:57

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: Error on upgrade

What have you done so far in trying to figure this out? You should always search the forums, but at the very least, you should have looked at this sticky: https://bbs.archlinux.org/viewtopic.php?id=130138

Edit: it looks like you've browsed through that section of the pacman page. And you've probably seent he sticky already, so ignore my "should have."

Last edited by nullified (2015-03-09 20:07:40)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#4 2015-03-09 20:06:30

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: Error on upgrade

Here is a similar (though not identical) thread with a solution.

Try removing whatever packages are conflicting with the filesystem. Use pacman or pkgfile to find out which packages to remove. Then try upgrading the system, and reinstalling whatever you need to. If you have to, you can rm the files but make sure to remove broken packages (can be found with `pacman -Qkk`) before upgrading, otherwise you may end up with multiple packages owning (and contending for) the same file path. I would also recommend removing any [community] and AUR packages you can, then reinstall after the upgrade. Remember that `pacman -R` without `-n` will leave your configuration files in place. If in doubt, backup /etc/ to your home directory first.

Offline

#5 2015-03-09 20:10:24

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Error on upgrade

yrral86 wrote:

(I have / on an ssd and several system directories are symlinked to a raid array).

That's probably the cause. Read about the recent changes in directory symlink handling on Allan's blog or one of the other threads discussing similar issues.

Offline

#6 2015-03-09 20:45:36

yrral86
Member
Registered: 2014-10-22
Posts: 8

Re: Error on upgrade

Thank you Raynman for something helpful.  This is indeed the issue.  I guess I need to convert all my symlinks to bind mounts.  Annoying, but I can see that it really is a cleaner way to specify this behavior.

"Can't you google?" and "Remove nearly every package" isn't very helpful guys...  Perhaps you should leave the suggestions to someone who actually took the time to understand what I wrote.

Offline

#7 2015-03-09 20:52:50

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: Error on upgrade

I didn't say google it. I asked if you searched the forums. And that can be very helpful. This exact issue was discussed and solved earlier today: https://bbs.archlinux.org/viewtopic.php?id=194113


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#8 2015-03-09 21:01:55

yrral86
Member
Registered: 2014-10-22
Posts: 8

Re: Error on upgrade

Well I redid /usr/share and tried a package that was hanging because of that and I still get the error for all the files (although now I don't get '/usr/share exists in filesystem', so yay progress).

The blog mentions running pacman-db-upgrade, but this does nothing since the db has already been upgraded.  Is there a way to have it rebuild the database?  If not, it seems like I could use a script to modify all of the /var/lib/pacman/local/packagename/files files to patch up the paths (raid/1/share/rest/of/path would become usr/share/rest/of/path).  With a backup beforehand, naturally.  However, there are also files called mtree in each directory that are binary.  It seems these files contain hashes and timestamps for verification, but I don't know if they will need modified as well.  I guess I'll find out after I make that backup smile.

Offline

#9 2015-03-09 21:10:58

yrral86
Member
Registered: 2014-10-22
Posts: 8

Re: Error on upgrade

Making the substitution in the files file fixed the issue and now I can install the package I tested this on.  I will now replace the rest of my symlinks and put together a script to clean up the rest of the package paths.

Thanks again Raynman.

@nullified Sorry, I did search a month ago when I first had the issue, but I didn't have time to mess with it until today.  Anyway, that thread does not contain the information I needed to repair my already upgraded, but corrupted database.  I have figured it out by being pointed in the right direction, and now this thread has the solution.  I'm sorry if you are annoyed by me needing help, but I thought that's what the forums were for.  Hopefully this can help someone else.

Last edited by yrral86 (2015-03-09 21:11:43)

Offline

#10 2015-03-09 21:40:39

yrral86
Member
Registered: 2014-10-22
Posts: 8

Re: Error on upgrade

My system is now up to date for the first time since I upgraded to pacman 4.2.

In case anyone else has the same issue in the future:
Add bind mounts for each symlink to /etc/fstab then

rm link; mkdir link; mount link

backup /var/lib/pacman/local and then replace the paths for each symlink you eliminated (for example raid/1/share -> usr/share)

cd /var/lib/pacman/local
for i in `ls -d */`; do cd $i; sudo perl -p -i -e 's/raid\/1\/share/usr\/share/' files; cd ..; done

now your pacman -Syu should work

Offline

Board footer

Powered by FluxBB