Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to safely emerge -e @world
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
petan
n00b
n00b


Joined: 18 Jan 2016
Posts: 55

PostPosted: Thu Jan 28, 2016 3:22 pm    Post subject: How to safely emerge -e @world Reply with quote

I had corrupt ram on my system and there is a chance that some binaries I emerged in past contain errors (some of them even used to segfault until I re-built them). In order to make my system stable I would like to rebuild pretty much everything.

My problem is that I have more than 1200 packages that needs rebuild, that would probably take few days. Now the real issue is that emerge works like this:

1: download next package
2.. compile
3. install
4. go back to 1

If any of these steps fail for whatever reason, whole process is terminated.

Is there any way to tell emerge "rebuild world from last package where you failed and skip those you already rebuilt"?

That is what I need to, basically track somehow what already was rebuilt and don't rebuild it again.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Thu Jan 28, 2016 3:37 pm    Post subject: Reply with quote

You might want to check about the --keep-going option of emerge.
Quote:
$ man emerge | sed -n '/--keep-going/,/^$/p'
So even if one package fails, emerge would continue emerging @world.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Thu Jan 28, 2016 3:55 pm    Post subject: Reply with quote

You could do something like:

Code:
# emerge -e --keep-going world

or:
Code:
# emerge -e world || until emerge --resume --skipfirst; do emerge --resume --skipfirst; done


(See man emerge for details of --keep-going, --resume and --skipfirst)
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Thu Jan 28, 2016 5:43 pm    Post subject: Reply with quote

petan,

On the good news front, there will be nothing to download unless you have emptied your distfiles directory.
Also, parallel-fetch has been the default for a long time now, so fetching carries on while building takes place.

You should use
Code:
emerge @world -e --keep-going --with-bdeps
since you want to rebuild build time only dependencies too.

Be aware of the difference between --keep-going and --resume --skipfirst.
When a package fails, --keep-going drops the failed packages and any packages that depend on it, then keeps going.
You get a list of issues at the end.

You can only use --resume --skipfirst after a build fail and it drops only the package that failed.

You might want to consider --jobs= too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Jan 29, 2016 9:28 am    Post subject: Reply with quote

NeddySeagoon wrote:
You should use

emerge @world -e --keep-going --with-bdeps

since you want to rebuild build time only dependencies too.

Good catch. I forgot to mention '--with-bdeps=y' as I have it declared in EMERGE_DEFAULT_OPTS in /etc/portage/make.conf.

In my view this is another good example of why '--with-bdeps=y' should be the default instead of '--with-bdeps=n' (as discussed in another recent thread: Is --with-bdeps=y generally recommended?). It's too easy to overlook.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Fri Jan 29, 2016 9:38 am    Post subject: Reply with quote

NeddySeagoon wrote:
You should use
Code:
emerge @world -e --keep-going --with-bdeps

or just
Code:
emerge @world @system -e --keep-going
?
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Jan 29, 2016 11:59 am    Post subject: Reply with quote

toralf wrote:
or just
Code:
emerge @world @system -e --keep-going
?

I was under the impression that the set @world includes the set @system and therefore adding @system would be superfluous. The file /usr/share/portage/config/sets/portage.conf includes the following lines for the @world set:

Quote:
# Not much that could be changed for world, so better leave it alone
[world]
class = portage.sets.base.DummyPackageSet
packages = @profile @selected @system

and the following lines for the @system set:

Quote:
# Same as for world, though later portage versions might use a different class
[system]
class = portage.sets.profiles.PackagesSystemSet

Portage Documentation, Chapter 2. Package Set Configuration - Part I. Configuration
Portage Documentation, Chapter 2. Package Set Configuration - Default Sets
Portage Documentation, Chapter 2. Package Set Configuration - sets.conf Syntax
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Fri Jan 29, 2016 12:17 pm    Post subject: Reply with quote

ok, so then --with-bdeps isn't necessary at all
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Jan 29, 2016 12:33 pm    Post subject: Reply with quote

toralf wrote:
ok, so then --with-bdeps isn't necessary at all

Why? Presumably some of the packages in the OP's @world set could have build-time dependencies that are not in the @system set, in which case adding '--with-bdeps=y' would cause those to be rebuilt too.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Fri Jan 29, 2016 1:30 pm    Post subject: Reply with quote

but "-e" covers IMO all (even built-time dep) packages, or ?
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Jan 29, 2016 3:16 pm    Post subject: Reply with quote

You could very well be correct (I'm no expert in Portage). man emerge shows the following for the two options:

Quote:
--with-bdeps < y | n >
In dependency calculations, pull in build time dependencies that are not strictly required. This defaults to ´n´ for installation actions, meaning they will not be installed, and ´y´ for the --depclean action, meaning they will not be removed. This setting can be added to EMERGE_DEFAULT_OPTS (see make.conf(5)) and later overridden via the command line.

Quote:
--emptytree (-e)
Reinstalls target atoms and their entire deep dependency tree, as though no packages are currently installed. You should run this with --pretend first to make sure the result is what you expect.

I suppose '--with-bdeps=y' might be a subset of '--emptytree', but I don't know if 'build-time dependencies that are not strictly required' is fully covered by 'entire deep dependency tree'. Hopefully someone who knows Portage inside out will chime in.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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