Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] accidentally deleted the /usr (I'm gonna kill myself!)
Date: Mon, 25 Aug 2014 12:50:09
Message-Id: CAGfcS_kQ7DfS7jA6Xnm8Xw6Pa99rJuFN2P73wyA9MSAdWJHngw@mail.gmail.com
In Reply to: Re: [gentoo-user] accidentally deleted the /usr (I'm gonna kill myself!) by behrouz khosravi
1 On Mon, Aug 25, 2014 at 7:52 AM, behrouz khosravi <bz.khosravi@×××××.com> wrote:
2 > On Mon, Aug 25, 2014 at 3:57 AM, Volker Armin Hemmann
3 > <volkerarmin@××××××××××.com> wrote:
4 >
5 >> and now you know why you should have added --buildpkg to your default
6 >> emerge options.
7 >
8 > Yeah, I am happy that I did it. I really don't like to compile
9 > chromium or libreoffice again!
10 >
11
12 There aren't a lot of great options in this situation, especially if
13 your toolchain is broken.
14
15 The simple solution is to copy /usr over from a stage3, but you're
16 going to end up with lots of orphans/etc that way. It isn't
17 super-clean, but if you do an immediate emerge -e world and then clean
18 up orphans in /usr that will probably take care of you.
19
20 A cleaner solution might be to set up your paths so that it searches
21 /usr first, and then the stage3. Then you could bootstrap your root
22 as if you were building a Gentoo Prefix install:
23 1. Set up your search paths to include the intact prefix/usr at the end.
24 2. Do an emerge -e @system. Maybe do it twice.
25 3. Remove your search paths so that you're using your root /usr.
26 4. Consider doing an extra emerge -e @system to ensure internal consistency.
27 5. Do an emerge -e world.
28
29 Variations on this might involve building binpkgs from a chroot and
30 installing those using the search path to let portage run.
31
32 One of these days I'll have to nuke /usr in a container and play
33 around with restoring it.
34
35 --
36 Rich