You are not logged in.
On my last update I was getting that conflicting files error "<filename> exists in filesystem", these files were obviously put there by a package but to solve this error I followed this suggestion and deleted them. However, there were lots of files listed. Most belonged under "/usr/lib/ruby/gems/2.7.0/gems/" directory so I was a bit reckless and deleted all of the contents of that dir without thinking. And now, with another update, I'm getting loads of "(No such file or directory)" issues by the command "pacman -Qk". This command provides the name of the packages whose files are missing so I've been installing them manually but there are plenty more to go... Some of these files belong to the AUR so I'm using an aur helper (yay, to be exact).
tl;dr
How do I reinstall all packages that have missing files?
And, in the future, how can I auto delete all files that cause conflict and do not have an owner?
Thank You
Last edited by zuntik (2020-06-17 19:11:38)
Offline
these files were "obviously" put there by a package
https://wiki.archlinux.org/index.php/Ru … ing_pacman …
How do I reinstall all packages that have missing files?
LC_ALL=C pacman -Qk 2>&1 | grep -E ', [1-9][0-9]* missing files' | cut -d':' -f1will print a list of "damaged" packages that you can review, edit and feed into pacman -S or yay
how can I auto delete all files that cause conflict and do not have an owner?
--overwrite <glob>
Bypass file conflict checks and overwrite conflicting files. If the package that is about to be installed contains files that are already installed and match glob,
this option will cause all those files to be overwritten. Using --overwrite will not allow overwriting a directory with a file or installing packages with
conflicting files and directories. Multiple patterns can be specified by separating them with a comma. May be specified multiple times. Patterns can be negated,
such that files matching them will not be overwritten, by prefixing them with an exclamation mark. Subsequent matches will override previous ones. A leading
literal exclamation mark or backslash needs to be escaped.
Offline
Or just `sudo pacman -Qknq | cut -d' ' -f 1` to get the list of packages. If you intend to review it, piping it through `sort -u` may also help if there are a lot of missing files. But I'd just pipe it to pacman anyways, there's no harm in reinstalling a package if there was some odd false positive:
sudo pacman -Qknq | cut -d' ' -f 1 | sudo pacman -S -I also included the 'n' for the first pacman to get just repo packages. You could run it again with 'm' in place of 'm' and pipe the final output to your aur helper instead of pacman (if it can take lists on stdin).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
pacman -Qknq | cut -d" " -f1 | sort | uniqThe uncondensed list can grow quite long (eg. if you NoExtract locales ;-)
Offline
sort | uniq => sort -u
But I have locales and man page translations in NoExtract, but these are not included in the Qk output.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thank you seth and Tribly!
Looks like seth's first answer did the trick!
Offline
sort | uniq => sort -u
But I have locales and man page translations in NoExtract, but these are not included in the Qk output.
Having it in NoExtract prevents the warning, because it's expected to not exist. On the other hand, if you install something with NoExtract rules, then later remove those rules, it can indeed generate rather a lot of warnings.
As for the original topic, let's paint the bikeshed a different color and use a dedicated, non-default alpm tool:
$ sudo pacman -S pacutils
$ paccheck --quiet --files
i-am-a-broken-package: '/path/to/file' missing file
$ paccheck --list-broken --files
i-am-a-broken-packageNo sorting, no uniq'ing, no redirecting stderr to stdout, no grep or cut.
--files only reports packages with missing files, there is a separate filter --file-properties for reporting permissions, file sizes, modification times, etc.
Of course, it could be done with just pacman alone, but where's the fun in that? ![]()
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline