Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I use emerge --sync my older .ebuild files are removed. How to get newer .ebuild-s, but not lose older ?

share|improve this question
What do you need (or want) the older ebuilds for? – David Z Aug 18 '11 at 5:25
up vote 3 down vote accepted

One way to do this should be to override the default portage rsync options excluding the deletion related options. The default options are currently hardcoded in /usr/lib/portage/pym/_emerge/ from line 2039 at my place.

Excluding "--force" and "--delete" you would add

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --whole-file --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

to /etc/make.conf. To the effect that no files or directories should get deleted any more.

Edit: Note that usually you would not want to keep any such ebuilds within the portage tree you're syncing to.

If you want to preserve specific ebuilds, there are two typical scenarios:

  • You are using an outdated ebuild that you want to keep.
  • You have written an ebuild yourself, or you found an ebuild somewhere, and added it to the portage tree you're syncing to.

In both these cases the best solution is to copy these ebuilds to a local overlay. You may also have to copy ebuilds they're depending on. Here's how to create a simple local overlay:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.