yay
yay copied to clipboard
ignore errors and continue to build more packages (skip failing packages)
Priority
medium ~~super low~~
Affected Version
yay v9.0.1 - libalpm v11.0.1
Issue
when i want to install many packages, but do not need all packages, i want yay to ignore build errors, and continue to build the next package.
sample:
yay -S $(
LANG=C \
yay -Ss gtk-theme- \
| grep -v '^ ' | grep -v '(Installed)$' \
| cut -d' ' -f1 | cut -d/ -f2 | sort -u | grep -v -- '-git$'
)
some packages fail to build, cos i must manually download source files, so now i have to either ...
... exclude failing packages with
| grep -v -e gtk-theme-+1 -e gtk-theme-absolute
... or, call yay in a loop
# install all the themes
for p in $(
LANG=C \
yay -Ss gtk-theme- \
| grep -v '^ ' | grep -v '(Installed)$' \
| cut -d' ' -f1 | cut -d/ -f2 | sort -u | grep -v -- '-git$'
)
do
yay --answerdiff None --answerclean All -S $p \
|| echo failed to build $p | tee -a yay.log
done
though no one will need this, 'install by glob pattern' would be nice
# proposition
yay --glob -S 'gtk-theme-*'
... but maybe there is someone with too much time : D
On the ignore errors there's been similar requests and I'm tempted to change it, I would still like it to identify if it was a dependency of a certain package and cancel that whole tree but that may be too ambitious.
About the globing, I'll see if there's a straightforward way of implementing it, behind an option is a good idea to avoid it being used casually, I think it's a use at your own risk option
Off topic but -Ssq
and --needed
would greatly simplify whatever you're trying to do here.
Today there was 5 packages to update: brave-bin, chromedriver, postman-bin, webstorm and webstorm-jre. I did:
$ yay -Suy
and then yay canceled the whole building process because of this error:
==> ERROR: One or more files did not pass the validity check!
Error downloading sources: webstorm (webstorm webstorm-jre)
I had to update the first 3 packages separately. It doesn't make sense to me that the building process is canceled because some packages (without dependencies) are failing.
I'd say the probably on this should be medium. Anyone with a lot of AUR packages installed will find it pretty impractical to do a bulk update with yay -Syu --aur
, with the way it's set up right now.
How about a naive implementation for now, which simply restarts the entire process and ignores any program which failed in the previous iteration. This is basically what we do manually, but I don't want to have to do it manually. I could maybe do this in a script, but if the optimal solution (pruning the dependency tree/graph on failure) is hard, then why don't we start with the most naive solution and iteratively improve the runtime performance?
I think many people would be happy with that compromise. In the meantime, I'm going to write a script to do the same, but I won't like it.
EDIT: Well it turns out it was easier than I expected: https://gist.github.com/norcalli/6b564e93e36ad37240067a479c7356eb
Related:
- Install as many packages as possible #1247
- Suggestion: have a way to continue interrupted AUR installs/builds. #1199
Are there any updates on this? I'd really like proper support for an option like this.
Well it turns out it was easier than I expected: https://gist.github.com/norcalli/6b564e93e36ad37240067a479c7356eb
LOL. why write one line if you can write 70 lines?
# update AUR packages, continue on errors
yay -Quq --aur | while read p; do yes '' | yay -S $p || echo $p >>yay-failed.log; done
# update all packages (repo + AUR), continue on errors
yay -Quq | while read p; do yes '' | yay -S $p || echo $p >>yay-failed.log; done
# install all gtk-theme-* packages, continue on errors
yay -Ssq gtk-theme- | grep ^gtk-theme- | while read p; do yes '' | yay -S $p || echo $p >>yay-failed.log; done
yay -Qu
shows packages to update
yay -Quq
shows only pkg names
yay -Quq --aur
shows only AUR pkgs to be updated
yes ''
will print \n
on all questions = default answer
to make yay less interactive, use something like yay --noremovemake --nocleanafter --answerclean None --answerdiff None --answeredit None
$ man pacman | grep -A1 -- --needed
--needed
Do not reinstall the targets that are already up-to-date.
.. may be useful
edit: yes
-> yes ''
can we not have an argument for this, instead of random bash wrappers?
# update all packages (repo + AUR), continue on errors yay -Quq | while read p; do yes | yay -S $p || echo $p >>yay-failed.log; done
This means if there's a number option (not yes/no) it loops forever telling you that's not one of the options. If you replace yes
with yes ''
(only newline instead of y), then it chooses the default every time there's a prompt and quits on a number option (or at least the one I ran into). In combination with the "make yay less interactive" options, this seems to work for me.
I want to work on this but every time I pick it up I see a small part of the install phase that needs to be refactored to make it happen properly and be properly tested, sorry for the delay
Simplifiying the response of @milahu:
Install AUR packages ignoring errors:
yay -Quq --aur | xargs -n 1 yay -S --noconfirm
Failed packages (not able to be installed):
yay -Quq --aur
As @adrianlzt said (thanks), but for pacaur
:
pacaur -Quq --aur | xargs -n 1 pacaur -S --noconfirm
implemented in yay-git
"newinstallengine": true,
in config will trigger this behavior (check yay -Pg
for current config)