Gentoo Archives: gentoo-user

From: Samir Faci <samir.list@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Gentoo Machine Cleanup
Date: Tue, 17 Jul 2007 15:57:03
Message-Id: 1e6142750707170851p6c54c021h379de4567cb0ff1e@mail.gmail.com
In Reply to: Re: [gentoo-user] Gentoo Machine Cleanup by "Abraham Marín Pérez"
1 I'm actually trying a slightly different approach that's almost equivalent
2 to doing a fresh install.
3
4 If I don't bork this up, I'll write a lil wiki on how to do this.
5
6 1. create a loopback file system. dd if=/dev/zero of=baseimage bs=1k
7 count=5242880 (5 gig image)
8 2. partition the baseimage
9 3. do your typical gentoo install on the baseimage file
10 4. sync data from baseimage fs, to / omitting /dev /proc /sys /home making
11 sure this is all backed up
12 5. rerun grub to make sure everything is proper
13 6. reboot and pray.
14
15 so, if I'm right, that should give me a clean fresh install. I'll take a
16 backup of my /etc directory and I need to remember to backup mysql db, but I
17 believe that should work fine. I would do this off a liveCD if I had
18 physical access to the machine.
19
20 It seems like the cleanest solution. if I run emerge -uDN (etc) world it
21 just keeps pulling X and other crap I removed, and since 80% of what's on
22 the machine it unneeded, a fresh start wouldn't hurt.
23
24 if anyone is interested, I'll post an update on how my install went once
25 it's back up.
26
27 --
28 Samir
29
30
31 On 7/17/07, Abraham Marín Pérez <tecnic5@××××××××.com> wrote:
32 >
33 > Mark Knecht escribió:
34 > > On 7/16/07, Samir Faci <samir.list@×××××.com> wrote:
35 > >> Hi all,
36 > >>
37 > >> So, I have a gentoo install that's slowly evolved over the past 3
38 > >> years
39 > >> or so years. It's now so cluttered with packages, it's becoming
40 > >> ridiculous,
41 > >> especially for a headless server. What I'd like to do is be able to
42 > >> remove
43 > >> all KDE/Gnome/X/gtk/qt/...etc out of the machine and not have it
44 > >> break the
45 > >> machine completely.
46 > >>
47 > >> Any suggestion on how to do go about this? At this stage, I'd like the
48 > >> server to have the basic system build, LAMP, and Postfix.
49 > >>
50 > >> If I start removing packages, then revdep complains about
51 > >> dependencies and
52 > >> ends pulling back the packages I had removed, same thing with world. I
53 > >> globally removed all the X related flags I can think of.
54 > >>
55 > >> Also, in the process of switching to a hardened profile, which is one
56 > >> reason
57 > >> why I wanted to clean up the install.
58 > >>
59 > >> Thanks again,
60 > >>
61 > >> Any help would be appreciated.
62 > >>
63 > >> --
64 > >> Samir
65 > >>
66 > >
67 > > Hi Samir,
68 > > You'll probably get some answers more detailed than mine but
69 > > fundamentally it goes something like this:
70 > >
71 > > 1) First do and emerge -DuN world and make sure everything is up to
72 > date.
73 > >
74 > > 2) By hand then emerge -C everything (for instance) with gnome or kde
75 > > in the package name.
76 > >
77 > > 3) Next do an emerge --depclean and let portage remove packages that
78 > > were needed for gnome or kde but not required now
79 > >
80 > > 4) Do a revdep-rebuild and see what it wants to pull in. If it's
81 > > trying to pull in something you don't think is necessary then do an
82 > > emerge -pe --tree and look at why it's getting pulled in. Either
83 > > remove what's causing it to get rebuilt or let it get pulled back in.
84 > >
85 > > At this point it's lather and repeat if necessary.
86 > >
87 > > I've done this a couple of times. It' works but be careful that you
88 > > don't reboot during the process as something might be gone that's
89 > > still necessary.
90 > >
91 > > Hope this helps,
92 > > Mark
93 > I'd proceed similar to this, but changing order:
94 >
95 > 1) Edit /var/lib/portage/world and unlist every unwanted package.
96 >
97 > 2) Edit /etc/make.conf and explicitly unset every use tag related to
98 > packages you don't want in your system.
99 >
100 > 3) run emerge --update --deep --newuse --ask world
101 >
102 > 4) run emerge --depclean --ask
103 >
104 > 5) run revdep-rebuild
105 >
106 > If you update your system before removing unwanted packages from world
107 > file you'll waste time updating packages that will be uninstalled
108 > afterwards (and big packages, must be said). This way you'll update only
109 > what you'll keep.
110 >
111 > Needless to say, it's always a good idea to back-up your system before
112 > proceeding.
113 >
114 > HTH,
115 > Abraham
116 >
117 > --
118 > --
119 > gentoo-user@g.o mailing list
120 >
121 >

Replies

Subject Author
Re: [gentoo-user] Gentoo Machine Cleanup Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] Gentoo Machine Cleanup Alan McKinnon <alan@××××××××××××××××.za>