| 1 | <?xml version='1.0' encoding='UTF-8'?> |
1 | <?xml version='1.0' encoding='UTF-8'?> |
| 2 | <!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
2 | <!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
| 3 | |
3 | |
| 4 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
4 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 5 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
5 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 6 | |
6 | |
| 7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.125 2012/07/24 12:12:52 swift Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.132 2013/01/20 18:11:00 swift Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <abstract> |
11 | <abstract> |
| 12 | After installing and configuring a stage3, the eventual result is that you |
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 |
13 | have a Gentoo base system at your disposal. This chapter describes how |
| 14 | to progress to that state. |
14 | to progress to that state. |
| 15 | </abstract> |
15 | </abstract> |
| 16 | |
16 | |
| 17 | <version>17</version> |
17 | <version>24</version> |
| 18 | <date>2012-07-24</date> |
18 | <date>2013-01-20</date> |
| 19 | |
19 | |
| 20 | <section> |
20 | <section> |
| 21 | <title>Chrooting</title> |
21 | <title>Chrooting</title> |
| 22 | <subsection> |
22 | <subsection> |
| 23 | <title>Optional: Selecting Mirrors</title> |
23 | <title>Optional: Selecting Mirrors</title> |
| 24 | <body> |
24 | <body> |
| 25 | |
25 | |
| 26 | <p> |
26 | <p> |
| 27 | In order to download source code quickly it is recommended to select a fast |
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 |
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 |
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 |
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 |
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 |
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 |
33 | provides you with a nice interface to select the mirrors you want. Just |
| … | |
… | |
| 74 | <p> |
74 | <p> |
| 75 | One thing still remains to be done before we enter the new environment and that |
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 |
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 |
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 |
78 | environment. <path>/etc/resolv.conf</path> contains the nameservers for your |
| 79 | network. |
79 | network. |
| 80 | </p> |
80 | </p> |
| 81 | |
81 | |
| 82 | <pre caption="Copy over DNS information"> |
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> |
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> |
84 | # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i> |
| 85 | </pre> |
85 | </pre> |
| 86 | |
86 | |
| 87 | </body> |
87 | </body> |
| 88 | </subsection> |
88 | </subsection> |
| 89 | <subsection test="not(func:keyval('arch')='IA64')"> |
89 | <subsection> |
| 90 | <title>Mounting the necessary Filesystems</title> |
90 | <title>Mounting the necessary Filesystems</title> |
| 91 | <body> |
91 | <body> |
| 92 | |
92 | |
| 93 | <p> |
93 | <p> |
| 94 | In a few moments, we will change the Linux root towards the new location. To |
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 |
95 | make sure that the new environment works properly, we need to make certain file |
| 96 | systems available there as well. |
96 | systems available there as well. |
| 97 | </p> |
97 | </p> |
| 98 | |
98 | |
| 99 | <p> |
99 | <p> |
| 100 | Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to |
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 |
101 | allow the installation to use the kernel-provided information within the |
| 102 | chrooted environment, and then mount-bind the <path>/dev</path> and |
102 | chrooted environment, and then mount-bind the <path>/dev</path> and |
| 103 | <path>/sys</path> filesystems. |
103 | <path>/sys</path> filesystems. |
| 104 | </p> |
104 | </p> |
| 105 | |
105 | |
| 106 | <pre caption="Mounting /proc and /dev"> |
106 | <pre caption="Mounting /proc and /dev"> |
| 107 | # <i>mount -t proc none /mnt/gentoo/proc</i> |
107 | # <i>mount -t proc none /mnt/gentoo/proc</i> |
| 108 | # <i>mount --rbind /sys /mnt/gentoo/sys</i> |
108 | # <i>mount --rbind /sys /mnt/gentoo/sys</i> |
| 109 | # <i>mount --rbind /dev /mnt/gentoo/dev</i> |
109 | # <i>mount --rbind /dev /mnt/gentoo/dev</i> |
| 110 | </pre> |
|
|
| 111 | |
|
|
| 112 | </body> |
|
|
| 113 | </subsection> |
|
|
| 114 | <subsection test="func:keyval('arch')='IA64'"> |
|
|
| 115 | <title>Mounting the /proc, /sys and /dev Filesystems</title> |
|
|
| 116 | <body> |
|
|
| 117 | |
|
|
| 118 | <p> |
|
|
| 119 | Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to |
|
|
| 120 | allow the installation to use the kernel-provided information within the |
|
|
| 121 | chrooted environment, and then mount-bind the <path>/dev</path> and |
|
|
| 122 | <path>/sys</path> filesystems. |
|
|
| 123 | </p> |
|
|
| 124 | |
|
|
| 125 | <pre caption="Mounting /proc /sys and /dev"> |
|
|
| 126 | # <i>mount -t proc none /mnt/gentoo/proc</i> |
|
|
| 127 | # <i>mount --rbind /dev /mnt/gentoo/dev</i> |
|
|
| 128 | # <i>mount --rbind /sys /mnt/gentoo/sys</i> |
|
|
| 129 | </pre> |
110 | </pre> |
| 130 | |
111 | |
| 131 | </body> |
112 | </body> |
| 132 | </subsection> |
113 | </subsection> |
| 133 | <subsection> |
114 | <subsection> |
| 134 | <title>Entering the new Environment</title> |
115 | <title>Entering the new Environment</title> |
| 135 | <body> |
116 | <body> |
| 136 | |
117 | |
| 137 | <p> |
118 | <p> |
| 138 | Now that all partitions are initialized and the base environment |
119 | Now that all partitions are initialized and the base environment |
| 139 | installed, it is time to enter our new installation environment by |
120 | installed, it is time to enter our new installation environment by |
| 140 | <e>chrooting</e> into it. This means that we change from the current |
121 | <e>chrooting</e> into it. This means that we change from the current |
| 141 | installation environment (Installation CD or other installation medium) to your |
122 | installation environment (Installation CD or other installation medium) to your |
| 142 | installation system (namely the initialized partitions). |
123 | installation system (namely the initialized partitions). |
| 143 | </p> |
124 | </p> |
| 144 | |
125 | |
| 145 | <p> |
126 | <p> |
| 146 | This chrooting is done in three steps. First we will change the root |
127 | This chrooting is done in three steps. First we will change the root |
| 147 | from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path> |
128 | from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path> |
| 148 | (on your partitions) using <c>chroot</c>. Then we will create a new environment |
129 | (on your partitions) using <c>chroot</c>. Then we will reload some settings, as |
| 149 | using <c>env-update</c>, which essentially creates environment variables. |
130 | provided by <path>/etc/profile</path>, in memory using <c>source</c>. |
| 150 | Finally, we load those variables into 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. |
| 151 | </p> |
133 | </p> |
| 152 | |
134 | |
| 153 | <pre caption = "Chrooting into the new environment"> |
135 | <pre caption = "Chrooting into the new environment"> |
| 154 | # <i>chroot /mnt/gentoo /bin/bash</i> |
136 | # <i>chroot /mnt/gentoo /bin/bash</i> |
| 155 | # <i>env-update</i> |
|
|
| 156 | >> Regenerating /etc/ld.so.cache... |
|
|
| 157 | # <i>source /etc/profile</i> |
137 | # <i>source /etc/profile</i> |
| 158 | # <i>export PS1="(chroot) $PS1"</i> |
138 | # <i>export PS1="(chroot) $PS1"</i> |
| 159 | </pre> |
139 | </pre> |
| 160 | |
140 | |
| 161 | <p> |
141 | <p> |
| 162 | Congratulations! You are now inside your own Gentoo Linux environment. |
142 | Congratulations! You are now inside your own Gentoo Linux environment. |
| 163 | Of course it is far from finished, which is why the installation still |
143 | Of course it is far from finished, which is why the installation still |
| 164 | has some sections left :-) |
144 | has some sections left :-) |
| 165 | </p> |
145 | </p> |
| 166 | |
146 | |
| 167 | <p> |
147 | <p> |
| 168 | If you at any time would need another terminal or console to access the chroot |
148 | If you at any time would need another terminal or console to access the chroot |
| 169 | environment, all you need to do is to execute the above steps again. |
149 | environment, all you need to do is to execute the above steps again. |
| 170 | </p> |
150 | </p> |
| 171 | |
151 | |
| 172 | </body> |
152 | </body> |
| 173 | </subsection> |
153 | </subsection> |
| 174 | </section> |
154 | </section> |
| 175 | |
155 | |
| 176 | <section> |
156 | <section id="installing_portage"> |
| 177 | <title>Configuring Portage</title> |
157 | <title>Configuring Portage</title> |
| 178 | <subsection> |
158 | <subsection> |
| 179 | <title>Updating the Portage tree</title> |
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 | |
| 180 | <body> |
179 | </body> |
|
|
180 | </subsection> |
|
|
181 | <subsection> |
|
|
182 | <title>Optional: Updating the Portage tree</title> |
|
|
183 | <body> |
| 181 | |
184 | |
| 182 | <p> |
185 | <p> |
| 183 | You should now update your Portage tree to the latest version. <c>emerge |
186 | You can now update your Portage tree to the latest version. <c>emerge |
| 184 | --sync</c> does this for you. |
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. |
| 185 | </p> |
189 | </p> |
| 186 | |
190 | |
| 187 | <pre caption="Updating the Portage tree"> |
191 | <pre caption="Updating the Portage tree"> |
| 188 | # <i>emerge --sync</i> |
192 | # <i>emerge --sync</i> |
| 189 | <comment>(If you're using a slow terminal like some framebuffers or a serial |
193 | <comment>(If you're using a slow terminal like some framebuffers or a serial |
| 190 | console, you can add the --quiet option to speed up this process:)</comment> |
194 | console, you can add the --quiet option to speed up this process:)</comment> |
| 191 | # <i>emerge --sync --quiet</i> |
195 | # <i>emerge --sync --quiet</i> |
| 192 | </pre> |
196 | </pre> |
| 193 | |
197 | |
| 194 | <p> |
198 | <p> |
| 195 | If you are behind a firewall that blocks rsync traffic, you can use |
199 | If you are behind a firewall that blocks rsync traffic, you safely ignore this |
| 196 | <c>emerge-webrsync</c> which will download and install a portage snapshot for |
200 | step as you already have a quite up-to-date Portage tree. |
| 197 | you. |
|
|
| 198 | </p> |
201 | </p> |
| 199 | |
202 | |
| 200 | <p> |
203 | <p> |
| 201 | If you are warned that a new Portage version is available and that you should |
204 | If you are warned that a new Portage version is available and that you should |
| 202 | update Portage, you should do it now using <c>emerge --oneshot portage</c>. |
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>. |
| 203 | </p> |
242 | </p> |
| 204 | |
243 | |
| 205 | </body> |
244 | </body> |
| 206 | </subsection> |
245 | </subsection> |
| 207 | <subsection> |
246 | <subsection> |
| 208 | <title>Choosing the Right Profile</title> |
247 | <title>Choosing the Right Profile</title> |
| 209 | <body> |
248 | <body> |
| 210 | |
249 | |
| 211 | <p> |
250 | <p> |
| 212 | First, a small definition is in place. |
251 | First, a small definition is in place. |
| 213 | </p> |
252 | </p> |
| 214 | |
253 | |
| 215 | <p> |
254 | <p> |
| 216 | A profile is a building block for any Gentoo system. Not only does it specify |
255 | A profile is a building block for any Gentoo system. Not only does it specify |
| 217 | default values for USE, CFLAGS and other important variables, it also locks |
256 | default values for USE, CFLAGS and other important variables, it also locks |