Handbook:Parts/Installation/Base/zh-cn

可选：选择境像站点
In order to download source code quickly it is recommended to select a fast mirror. Portage will look in the file for the GENTOO_MIRRORS variable and use the mirrors listed therein. It is possible to surf to the Gentoo mirror list and search for a mirror (or mirrors) that is close to the system's physical location (as those are most frequently the fastest ones). However, we provide a nice tool called which provides users with a nice interface to select the mirrors needed. Just navigate to the mirrors of choice and press to select one or more mirrors.

A second important setting is the SYNC setting in. This variable contains the rsync server to use when updating the Portage tree (the collection of ebuilds and related files containing all the information Portage needs to download and install software). Again, it is possible to manually enter a SYNC server, but can ease that operation considerably:

After running it is advisable to double-check the settings in  !

复制DNS信息
One thing still remains to be done before entering the new environment and that is copying over the DNS information in. This needs to be done to ensure that networking still works even after entering the new environment. contains the name servers for the network.

To copy this information, it is recommended to use the  option to the  command. This ensures that, if is a symbolic link, that the link's target file is copied instead of the symbolic link itself. Otherwise in the new environment the symbolic link would point to a non-existing file (as the link's target is most likely not available inside the new environment).

挂载必要的文件系统
几分钟后,Linux的root将变更到新的位置. 确保新环境工作正常. 文件系统需要确保正常可用.

需要被提供的文件系统是：


 * which is a pseudo-filesystem (it looks like regular files, but is actually generated on-the-fly) from which the Linux kernel exposes information to the environment
 * which is a pseudo-filesystem, like which it was once meant to replace, and is more structured than
 * is a regular file system, partially managed by the Linux device manager (usually ), which contains all device files

The location will be mounted on  whereas the other two are bind-mounted. The latter means that, for instance, will actually be  (it is just a second entry point to the same filesystem) whereas  is a new mount (instance so to speak) of the filesystem.

进入新环境
现在所有的分区都已经被初始化，基本环境也已安装完毕，现在是到了该用chroot进入新安装环境的时候了. 这意味着我们从当前安装环境（安装光盘或者其他安装介质）切换到你安装的系统里（也就是被初始化的分区）. 因此命名为change root或chroot.

完成chroot有三步.


 * 1) The root location is changed from  (on the installation medium) to  (on the partitions) using chroot
 * 2) Some settings (those in ) are reloaded in memory using the  command
 * 3) The primary prompt is changed to help us remember that this session is inside a chroot environment.

From this point, all actions performed are immediately on the new Gentoo Linux environment. Of course it is far from finished, which is why the installation still has some sections left :-)

安装Portage树快照
接下来，是安装Portage快照，它可用告诉Portage哪些软件可用于安装，管理员可以选择它的配置文件，等等.

The use of is recommended. This will fetch the latest Portage snapshot (which Gentoo releases on a daily basis) from one of Gentoo's mirrors and install it onto the system.

从此时开始，Portage的可能提及建议要执行某些更新要执行. 这是因为stage3的文件安装了某些系统软件包可能有较新的版本可用. 这是因为一个新的Portage快照安装，而系统发现到了这一点. 这个现在可以安全地忽略；过后安装Gentoo完成，可以再触发它的更新.

可选：更新Portage树
Portage树可以更新到最新版本. 前面的 命令将安装一个最近Portage快照(通常是最近的24 小时)这一步是可选的.

Suppose there is a need for the last package updates (up to 1 hour), then use. This command will use the rsync protocol to update the Portage tree (which was fetched earlier on through ) to the latest state.

On slow terminals, like some framebuffers or serial consoles, it is recommended to use the  option to speed up the process:

阅读新闻条目
Portage 树同步到系统时,它可能会提供类似于下面的信息来警告用户:

Portage news items were created to provide a communication medium to push critical messages to users via the rsync tree. To manage them, use. The application is a Gentoo application that allows for a common management interface towards system changes and operations. In this case, is asked to use its   module.

For the  module, three operations are most used:


 * With  an overview of the available news items is displayed.
 * With  the news items can be read.
 * With  news items can be removed once they have been read and will not be reread anymore.

更多关于新闻阅读器的信息可以通过其手册页查看:

选择正确的Profile
A profile is a building block for any Gentoo system. Not only does it specify default values for USE, CFLAGS , and other important variables, it also locks the system to a certain range of package versions. This is all maintained by the Gentoo developers.

You can see what profile the system is currently using with, now using the  module:

可以看到,也有用于一些架构的桌面的profile文件.

After viewing the available profiles for the architecture, users can select a different profile to use:

配置USE变量
USE 是Gentoo为用户提供的最具威力的变量之一. 很多程序通过它可以选择编译或者不编译某些可选的支持. 例如，一些程序可以在编译时加入对gtk或是对qt的支持. 其它的程序可以在编译时加入或不加入对于SLL的支持. 有些程序甚至可以在编译时加入对帧缓冲的支持（svgalib）以取代X11（X服务器）.

大多数的发行版会使用尽可能多的支持特性编译它们的软件包，这既增加了软件的大小也减慢了启动时间，而这些还没有算上可能会涉及到的大量依赖性问题. Gentoo可以让你自己定义软件编译的选项，而这正是 USE 要做的事.

在 USE 变量里你可以定义关键字，它被用来对应相应的编译选项. 比如，ssl会让程序在它编译时加入对它的支持. 会移除其对于X服务器的支持（注意前面的减号）. 将会在你编译软件的时候添加对gnome（和gtk）的支持，并且移除对kde（和qt）的支持，这可以让你的系统尽可能多的为GNOME桌面做优化.

The default USE settings are placed in the files of the Gentoo profile used by the system. Gentoo uses a (complex) inheritance system for its profiles, which we will not dive into at this stage. The easiest way to check the currently active USE settings is to run and select the line that starts with USE:

A full description on the available USE flags can be found on the system in.

Inside the command, scrolling can be done using the  and  keys, and exited by pressing.

举个例子，接下来我们展示一个基于KDE的系统并带有DVD、ALSA以及光盘刻录支持的USE设置：

When USE is defined in it is added (or removed if the USE flag starts with the  sign) from that default list. Users who want to ignore any default USE settings and manage it completely themselves should start the USE definition in with  :

时区
Select the timezone for the system. Look for the available timezones in, then write it in the file.

假设选择的时区是Europe/Brussels:

Please avoid the timezones as their names do not indicate the expected zones. For instance, is in fact.

Next, reconfigure the package, which will update the  file for us, based on the  entry. The file is used by the system C library to know the timezone the system is in.

区域设置
大多数用户只需要在他们的系统上使用一个或两个地区.

语言环境不仅指定系统应使用与系统进行交互的语言，也指默认按什么字符串进行排序，显示日期和时间等.

The locales that a system should support should be mentioned in.

The following locales are an example to get both English (United States) and German (Germany) with the accompanying character formats (like UTF-8).

下一步是运行. 它将生成所有地区中指定的 文件.

要来验证所选地区，运行命令.

Once done, it is now time to set the system-wide locale settings. Again we use for this, now with the   module.

在 ,可显示可用的选项:

With the correct locale can be set:

Manually, this can still be accomplished through the file:

Make sure a locale is set, as the system would otherwise display warnings and errors during kernel builds and other software deployments later in the installation.

Now reload the environment:

We made a full Localization guide to help the user guide through this process. Another interesting article is the UTF-8 guide for very specific information to enable UTF-8 on the system.