Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Re-trying an emerge of many failed packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
dr_wulsen
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2013
Posts: 146
Location: Austria

PostPosted: Sat May 09, 2020 11:42 pm    Post subject: Re-trying an emerge of many failed packages Reply with quote

If during a world update you get lots of failed emerges, you can prepare yourself for that.
Mild warning: This method will delete your old emerge logs of failed jobs, you've been warned.
  • Enable the portage ELOG system through make.conf
    PORTAGE_ELOG_SYSTEM="save"
    PORTAGE_ELOG_CLASSES="warn error log qa"

  • If it has been enabled before, purge the log directory: rm -rf /var/log/portage/elog/*
  • If emerges break, the log will be saved on disk, for later reference.
  • To get the list together: cd /var/log/portage/elog (or wherever you keep your logs)
  • grep -lr ERROR:.*failed | cut -d ':' -f '1-2'| sort | uniq will output it to stdout
  • grep -lr ERROR:.*failed | cut -d ':' -f '1-2'| sort | uniq | sed -e 's/\:/\//' -e 's/-[[:digit:]].*//' does the same, but without version numbers.
    This comes in handy when a newer version became available in the meantime and you'd like to do a batch-retry.

  • To re-emerge all packages that failed, generate the list and save it to a file
  • cd /var/log/portage/elog
  • grep -lr ERROR:.*failed | cut -d ':' -f '1-2'| sort | uniq > /var/tmp/failedpackages.list
  • Delete the old failed logs: for i in $(grep -lr ERROR:.*failed); do rm "$i";done
  • Input the file of failed packages to the emerge command:
  • emerge -1 --keep-going $(cat /var/tmp/failedpackages.list)
  • Watch it succeed or fail, on errors there will be only the current failed jobs in the log dir, so you have an easy time viewing them with elogv

This helped me just now, as GCC10 did not behave as nice as 9.3 did and a lot of packages failed with the same error.
One change to make.conf, this few lines in bash and the ~70 failed packages are trying again already :)
_________________
There's no stupid questions, only stupid answers.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun May 10, 2020 1:06 am    Post subject: Reply with quote

Nice idea. I have 2 questions:
  1. Why do you use ELOG? Wouldn't it be sufficient to use the directories that were left over in '/var/tmp/portage'? Something like:
    Code:
    cd /var/tmp/portage; ls -d */* >/var/tmp/failedpackages.list

  2. Does it really work? When I run
    Code:
    emerge --empty --keep-going @world

    (and that's the only situation where I use '--keep-going') and emerge can't emerge some packages, it will continue - but it will also silently drop packages that depend on the failed packages.

    Does emerge write messages for those dropped packages to the ELOG system? Will your grep commands find those packages and will your re-emerge command emerge those packages? Or will your re-emerge command skip the dropped packages as well?

PS: Below the relevant section from 'man emerge':
Quote:
--keep-going [ y | n ]

Continue as much as possible after an error. When an error occurs, dependencies are recalculated for remaining packages and any with unsatisfied dependencies are automatically dropped. [..]
Back to top
View user's profile Send private message
dr_wulsen
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2013
Posts: 146
Location: Austria

PostPosted: Sun May 10, 2020 1:22 am    Post subject: Reply with quote

mike, that's a good point. so i'd have to disable fail-clean, which is a pain if you are emerging libreoffice, firefox, kicad and multiple big packs fail. 16GB RAM is not little, but also not infinite.
Do you have a suggestion on what one could do here?
_________________
There's no stupid questions, only stupid answers.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun May 10, 2020 1:49 am    Post subject: Reply with quote

I usually run
Code:
emerge --update --deep --changed-use @world

and sometimes
Code:
emerge --empty @world

Emerge will stop if it can't emerge a package. I usually try to solve the problem aright away. After that, I use one of the commands below to continue:
Code:
emerge --resume
emerge --resume --skip-first
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum