Saturday, June 30, 2012

File System Conflict Error During Updates

I usually update Arch Linux twice a week. Today I updated and issued:

$pacman -Syu

It proceeded to download the packages but stopped at:

Error:{package}/path/to/file already exists in the filesystem
could not proceed with update.



Taken from wiki.archlinux.org/pacman

Why this is happening: pacman has detected a file conflict, and by design, will not overwrite files for you. This is a design feature, not a flaw.

The issue is usually trivial to solve. A safe way is to first check if another package owns the file (pacman -Qo /path/to/file). If the file is owned by another package, file a bug report. If the file is not owned by another package, rename the file which 'exists in filesystem' and re-issue the update command. If all goes well, the file may then be removed.

If you had installed a program manually without using pacman or a frontend, you have to remove it and all its files and reinstall properly using pacman.

Every installed package provides /var/lib/pacman/local/$package-$version/files file that contains metadata about this package. If this file gets corrupted - is empty or missing - it results in "file exists in filesystem" errors when trying to update the package. Such an error usually concerns only one package and instead of manually renaming and later removing all the files that belong to the package in question, you can run pacman -S --force $package to force pacman to overwrite these files.

Do not run pacman -Syu --force.

In my case only the {package} is involved so I can safely issue the --force flag with pacman. I guess it's the only exception to the rule.

I did:
$pacman -S {package} --force

Then:
$pacman -Syu

My problem is solved.
Post a Comment

Wisdom From Gandalf