/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-system.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-system.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.132 - (show annotations) (download) (as text)
Sun Jan 20 18:11:00 2013 UTC (18 months, 1 week ago) by swift
Branch: MAIN
Changes since 1.131: +39 -3 lines
File MIME type: application/xml
Fix bug #450038 - Add information on news items, thanks to Pacho Ramos

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.131 2013/01/20 15:58:28 swift Exp $ -->
8
9 <sections>
10
11 <abstract>
12 After installing and configuring a stage3, the eventual result is that you
13 have a Gentoo base system at your disposal. This chapter describes how
14 to progress to that state.
15 </abstract>
16
17 <version>24</version>
18 <date>2013-01-20</date>
19
20 <section>
21 <title>Chrooting</title>
22 <subsection>
23 <title>Optional: Selecting Mirrors</title>
24 <body>
25
26 <p>
27 In order to download source code quickly it is recommended to select a fast
28 mirror. Portage will look in your <path>make.conf</path> file for the
29 GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
30 our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
31 for a mirror (or mirrors) close to you (as those are most frequently the
32 fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
33 provides you with a nice interface to select the mirrors you want. Just
34 navigate to the mirrors of choice and press spacebar to select one or more
35 mirrors.
36 </p>
37
38 <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
39 # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/portage/make.conf</i>
40 </pre>
41
42 <p>
43 A second important setting is the SYNC setting in <path>make.conf</path>. This
44 variable contains the rsync server you want to use when updating your Portage
45 tree (the collection of ebuilds, scripts containing all the information Portage
46 needs to download and install software). Although you can manually enter a SYNC
47 server for yourself, <c>mirrorselect</c> can ease that operation for you:
48 </p>
49
50 <pre caption="Selecting an rsync mirror using mirrorselect">
51 # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/portage/make.conf</i>
52 </pre>
53
54 <p>
55 After running <c>mirrorselect</c> it is adviseable to double-check the settings
56 in <path>/mnt/gentoo/etc/portage/make.conf</path> !
57 </p>
58
59 <note>
60 If you want to manually set a SYNC server in <path>make.conf</path>, you should
61 check out the <uri link="/main/en/mirrors-rsync.xml">community mirrors
62 list</uri> for the mirrors closest to you. We recommend choosing a
63 <e>rotation</e>, such as <c>rsync.us.gentoo.org</c>, rather than choosing a
64 single mirror. This helps spread out the load and provides a failsafe in case a
65 specific mirror is offline.
66 </note>
67
68 </body>
69 </subsection>
70 <subsection>
71 <title>Copy DNS Info</title>
72 <body>
73
74 <p>
75 One thing still remains to be done before we enter the new environment and that
76 is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
77 to do this to ensure that networking still works even after entering the new
78 environment. <path>/etc/resolv.conf</path> contains the nameservers for your
79 network.
80 </p>
81
82 <pre caption="Copy over DNS information">
83 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
84 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i>
85 </pre>
86
87 </body>
88 </subsection>
89 <subsection>
90 <title>Mounting the necessary Filesystems</title>
91 <body>
92
93 <p>
94 In a few moments, we will change the Linux root towards the new location. To
95 make sure that the new environment works properly, we need to make certain file
96 systems available there as well.
97 </p>
98
99 <p>
100 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
101 allow the installation to use the kernel-provided information within the
102 chrooted environment, and then mount-bind the <path>/dev</path> and
103 <path>/sys</path> filesystems.
104 </p>
105
106 <pre caption="Mounting /proc and /dev">
107 # <i>mount -t proc none /mnt/gentoo/proc</i>
108 # <i>mount --rbind /sys /mnt/gentoo/sys</i>
109 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
110 </pre>
111
112 </body>
113 </subsection>
114 <subsection>
115 <title>Entering the new Environment</title>
116 <body>
117
118 <p>
119 Now that all partitions are initialized and the base environment
120 installed, it is time to enter our new installation environment by
121 <e>chrooting</e> into it. This means that we change from the current
122 installation environment (Installation CD or other installation medium) to your
123 installation system (namely the initialized partitions).
124 </p>
125
126 <p>
127 This chrooting is done in three steps. First we will change the root
128 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
129 (on your partitions) using <c>chroot</c>. Then we will reload some settings, as
130 provided by <path>/etc/profile</path>, in memory using <c>source</c>.
131 The last step is to redefine the primary prompt to help us remember that we are
132 inside a chroot environment.
133 </p>
134
135 <pre caption = "Chrooting into the new environment">
136 # <i>chroot /mnt/gentoo /bin/bash</i>
137 # <i>source /etc/profile</i>
138 # <i>export PS1="(chroot) $PS1"</i>
139 </pre>
140
141 <p>
142 Congratulations! You are now inside your own Gentoo Linux environment.
143 Of course it is far from finished, which is why the installation still
144 has some sections left :-)
145 </p>
146
147 <p>
148 If you at any time would need another terminal or console to access the chroot
149 environment, all you need to do is to execute the above steps again.
150 </p>
151
152 </body>
153 </subsection>
154 </section>
155
156 <section id="installing_portage">
157 <title>Configuring Portage</title>
158 <subsection>
159 <title>Unpacking a Portage Snapshot</title>
160 <body>
161
162 <p>
163 You now have to install a Portage snapshot, a collection of files that inform
164 Portage what software titles you can install, which profiles are available, etc.
165 The contents of this snapshot will be extracted to <path>/usr/portage</path>.
166 </p>
167
168 <p>
169 We recommend the use of <c>emerge-webrsync</c>. This will fetch the latest
170 portage snapshot (which Gentoo releases on a daily basis) from one of our mirrors
171 and install it onto your system.
172 </p>
173
174 <pre caption="Running emerge-webrsync to install a Portage snapshot">
175 # <i>mkdir /usr/portage</i>
176 # <i>emerge-webrsync</i>
177 </pre>
178
179 </body>
180 </subsection>
181 <subsection>
182 <title>Optional: Updating the Portage tree</title>
183 <body>
184
185 <p>
186 You can now update your Portage tree to the latest version. <c>emerge
187 --sync</c> will use the rsync protocol to update the Portage tree (which
188 you fetched earlier on through <c>emerge-webrsync</c>) to the latest state.
189 </p>
190
191 <pre caption="Updating the Portage tree">
192 # <i>emerge --sync</i>
193 <comment>(If you're using a slow terminal like some framebuffers or a serial
194 console, you can add the --quiet option to speed up this process:)</comment>
195 # <i>emerge --sync --quiet</i>
196 </pre>
197
198 <p>
199 If you are behind a firewall that blocks rsync traffic, you safely ignore this
200 step as you already have a quite up-to-date Portage tree.
201 </p>
202
203 <p>
204 If you are warned that a new Portage version is available and that you should
205 update Portage, you should do it now using <c>emerge --oneshot portage</c>. You
206 might also be notified that "news items need reading". More on that next.
207 </p>
208
209 </body>
210 </subsection>
211 <subsection>
212 <title>Reading News Items</title>
213 <body>
214
215 <p>
216 When a Portage tree is synchronized to your system, Portage might warn you with
217 the following:
218 </p>
219
220 <pre caption="Portage informing that news items are available">
221 * IMPORTANT: 2 news items need reading for repository 'gentoo'.
222 * Use eselect news to read news items.
223 </pre>
224
225 <p>
226 Portage news items were created to provide a communication medium to push
227 critical messages to users via the rsync tree. To manage them you will need to
228 use <c>eselect news</c>. With the <c>read</c> subcommand, you can read all news
229 items. With <c>list</c> you can get an overview of the available news items, and
230 with <c>purge</c> you can remove them once you have read them and have no
231 further need for the item(s) anymore.
232 </p>
233
234 <pre caption="Handling Portage news">
235 # <i>eselect news list</i>
236 # <i>eselect news read</i>
237 </pre>
238
239 <p>
240 More information about the newsreader is available through its manual page:
241 <c>man news.eselect</c>.
242 </p>
243
244 </body>
245 </subsection>
246 <subsection>
247 <title>Choosing the Right Profile</title>
248 <body>
249
250 <p>
251 First, a small definition is in place.
252 </p>
253
254 <p>
255 A profile is a building block for any Gentoo system. Not only does it specify
256 default values for USE, CFLAGS and other important variables, it also locks
257 the system to a certain range of package versions. This is all maintained by the
258 Gentoo developers.
259 </p>
260
261 <p>
262 Previously, such a profile was untouched by the users. However, there may be
263 certain situations in which you may decide a profile change is necessary.
264 </p>
265
266 <p>
267 You can see what profile you are currently using with the following command:
268 </p>
269
270 <pre caption="Verifying system profile">
271 # <i>eselect profile list</i>
272 Available profile symlink targets:
273 [1] <keyval id="profile"/> *
274 [2] <keyval id="profile"/>/desktop
275 [3] <keyval id="profile"/>/server
276 </pre>
277
278 <p>
279 As you can see, there are also <c>desktop</c> and <c>server</c> subprofiles available for some
280 architectures. Running <c>eselect profile list</c> will show all available
281 profiles.
282 </p>
283
284 <p>
285 After viewing the available profiles for your architecture, you can use a
286 different one if you wish:
287 </p>
288
289 <pre caption="Changing profiles">
290 # <i>eselect profile set 2</i>
291 </pre>
292
293 <p test="func:keyval('arch')='AMD64'">
294 If you want to have a pure 64-bit environment, with no 32-bit applications or
295 libraries, you should use a non-multilib profile:
296 </p>
297
298 <pre test="func:keyval('arch')='AMD64'" caption="Switching to a non-multilib profile">
299 # <i>eselect profile list</i>
300 Available profile symlink targets:
301 [1] <keyval id="profile"/> *
302 [2] <keyval id="profile"/>/desktop
303 [3] <keyval id="profile"/>/no-multilib
304 [4] <keyval id="profile"/>/server
305 <comment>(Choose the no-multilib profile)</comment>
306 # <i>eselect profile set 3</i>
307 <comment>(Verify the change)</comment>
308 # <i>eselect profile list</i>
309 Available profile symlink targets:
310 [1] <keyval id="profile"/>
311 [2] <keyval id="profile"/>/desktop
312 [3] <keyval id="profile"/>/no-multilib *
313 [4] <keyval id="profile"/>/server
314 </pre>
315
316 <note>
317 The <c>developer</c> subprofile is specifically for Gentoo Linux development
318 tasks. It is <e>not</e> meant to help set up general development environments.
319 </note>
320
321 </body>
322 </subsection>
323 <subsection id="configure_USE">
324 <title>Configuring the USE variable</title>
325 <body>
326
327 <p>
328 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
329 Several programs can be compiled with or without optional support for certain
330 items. For instance, some programs can be compiled with gtk-support, or with
331 qt-support. Others can be compiled with or without SSL support. Some programs
332 can even be compiled with framebuffer support (svgalib) instead of X11 support
333 (X-server).
334 </p>
335
336 <p>
337 Most distributions compile their packages with support for as much as possible,
338 increasing the size of the programs and startup time, not to mention an enormous
339 amount of dependencies. With Gentoo you can define what options a package
340 should be compiled with. This is where <c>USE</c> comes into play.
341 </p>
342
343 <p>
344 In the <c>USE</c> variable you define keywords which are mapped onto
345 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
346 programs that support it. <e>-X</e> will remove X-server support (note the
347 minus sign in front). <e>gnome gtk -kde -qt4</e> will compile your
348 programs with gnome (and gtk) support, and not with kde (and qt) support,
349 making your system fully tweaked for GNOME.
350 </p>
351
352 <p>
353 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
354 files of your profile. You will find <path>make.defaults</path> files in the
355 directory which <path>/etc/portage/make.profile</path> points to and all parent
356 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
357 settings in all <path>make.defaults</path> files. What you place in
358 <path>/etc/portage/make.conf</path> is calculated against these defaults
359 settings. If you add something to the <c>USE</c> setting, it is added to the
360 default list. If you remove something from the <c>USE</c> setting (by placing
361 a minus sign in front of it) it is removed from the default list (if it was
362 in the default list at all). <e>Never</e> alter anything inside the
363 <path>/etc/portage/make.profile</path> directory; it gets overwritten when
364 you update Portage!
365 </p>
366
367 <p>
368 A full description on <c>USE</c> can be found in the second part of the Gentoo
369 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
370 the available USE flags can be found on your system in
371 <path>/usr/portage/profiles/use.desc</path>.
372 </p>
373
374 <pre caption="Viewing available USE flags">
375 # <i>less /usr/portage/profiles/use.desc</i>
376 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
377 </pre>
378
379 <p>
380 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
381 and CD Recording support:
382 </p>
383
384 <pre caption="Opening /etc/portage/make.conf">
385 # <i>nano -w /etc/portage/make.conf</i>
386 </pre>
387
388 <pre caption="USE setting">
389 USE="-gtk -gnome qt4 kde dvd alsa cdr"
390 </pre>
391
392 </body>
393 </subsection>
394 </section>
395 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20