第三次安装了,这次能成功吗?
主要参考文章:
http://blog.segmentfault.com/genedna/1190000000338952
及官方的:
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml
安装从这个“Installing the Gentoo Installation Files:看起走。
下面我开始说明安装步骤
1.下载好三个文件:
install-x86-minimal-20140211.iso
portage-20140222.tar.bz2
stage3-i486-20140211.tar.bz2
2.进入LiveCD
建VMware虚拟机,加载install-x86-minimal-20140211.iso进入LiveCD。我选的是Other 3.x kernel.
3.设置网络
用 Minimal Install CD 光盘启动进入到 livecd 的环境,在安装前需要设置网络环境。 如果网络环境里配置了DHCP,通过命令ifconfig 命令检查机器是否分配到IP。
可以通过下面的几条命令自行设置,也可以使用 net-setup 命令进行设置:
ifconfig eth0 192.168.1.10/24 #设置IP地址:192.168.1.10 route add default gw 192.168.1.1 #设置网关:192.168.1.1 echo nameserver 192.168.1.1 > /etc/resolv.conf #设置域名解析服务器
Important
实际过程中有可能遇到从 Minimal Install CD 启动后,系统无法找到网卡,使得安装无法进行下去。遇到此类问题需要查看网卡的硬件情况,查看是否有加载对应的驱动模块。譬如在DELL R610 机型中使用Broadcom Corporation NetXtreme II 5709C 双端口千兆以太网卡时遇到虽然加载了驱动模块,但是依然无法识别网卡的情况,最终先将驱动模块删除再重新加载后才使得网卡设备被识别。
lspci -k #查询到网卡的驱动模块为bnx2。 lsmod #查询是否加载了bnx2驱动模块。 rmmod bnx2 #移除加载的bnx2驱动模块。 modprobe bnx2 #重新加载驱动模块。 net-setup eth0 #设置网络。
Important
如果使用新版本的 Minimal Install CD,由于 udev 版本已经升级到 200 以上,不一定能使用 eth0 来连接网络,新的连接的名称可以用以下代码来获得:
udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null
名称一般为 enps。
4.设置密码及启动ssh
# psswd root
#/etc/init.d/sshd start
5.上传文件
用Windows 连接上刚才的Gentoo Install LiveCD虚拟机,上传portage-20140222.tar.bz2到/mnt/gentoo/下。上传stage3-i486-20140211.tar.bz2到/mnt/gentoo/usr/下
好!文件准备好了。
6.格式化磁盘
# cfdisk
#mkfs.ext4 /dev/sad1
#mkswap /dev/sda2
#/mkfs.ext4 /dev/sda3
#partprobe
7.解压文件到目录
解压portage-20140222.tar.bz2到/mnt/gentoo/下。
解压stage3-i486-20140211.tar.bz2到/mnt/gentoo/usr/下
8.配置编译选项
nano -w /mnt/gentoo/portage/make.conf
添加:
MAKEOPTS="-j3" 设置:USE="bindist unicode bash-completion vim-syntax jpeg png mmx sse sse2" make.conf 例子:
添加镜像地址:GENTOO_MIRRORS="http://mirrors.sohu.com/gentoo/" SYNC="rsync://rsync.cn.gentoo.org/gentoo-portage"
9.复制DNS信息cp -L /etc/resolv.conf /mnt/gentoo/etc/
10.挂载/proc and /dev# mount -t proc proc /mnt/gentoo/proc # mount --rbind /sys /mnt/gentoo/sys # mount --rbind /dev /mnt/gentoo/dev
11.chroot# chroot /mnt/gentoo /bin/bash # source /etc/profile # export PS1="(chroot) $PS1"
12.Running emerge-webrsync to install a Portage snapshot# emerge-webrsync
13.Updating the Portage tree# emerge --sync
14.Choose the right profile
list profile
# eselect profile list
#eselecct profile set n
15.Viewing available USE flags
# less /usr/portage/profiles/use.desc
16. 编辑make.conf
第8步时已经修改过了。
VMWare安装注意make.conf中应是:
INPUT_DEVICES="evdev vmmouse"
VIDEO_CARDS="vmware"要不然可以会出现"no screen found"错误
17.设置时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
18.Configure locales
# nano -w /etc/locale.gen
要用的locale都配置上。
可参考:
gentoo的中文化一直是gentoo新手的遇到的一个特别头痛的问题,比如说,桌面的中文化,中文输入法的安装,amarok中文乱码,挂载分区的乱码,等等。
其中的一些基本问题我已经在我的博客中总结了:
http://zhongbeyond.blog.sohu.com/114005695.html
下面我总结一下中文locale的设定:
1. 先修改locale.gen文件
#gedit /etc/locale.gen
代码:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
保存执行locale-gen:
#locale-gen
2.建立 /etc/env.d/02locale
#gedit /etc/env.d/02locale
在文本中输入:
LANG="zh_CN.GBK"
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
保存后执行:
#env-update && source /etc/profile
如果要安装scim输入法的话,你还需要建立: /etc/env.d/100i18n 文件。
#gedit /etc/env.d/100i18n
输入:
LANG=en_US.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
保存后执行:
#env-update && source /etc/profile
19.使locale生效
Running locale-gen
#locale-gen
20.选择locale# eselect locale list # eselect locale set n 21.Reload shell environment# env-update && source /etc/profile 22.用genkernel安装kernel 先执行: #emerge gentoo-sources# emerge genkernel emerge时可能会提示应使用用"genkernel-next",修改"nano -w /usr/portage/profiles/targets/systemd/package.mask"后正常完成。#genkernel all
23.编辑fstab# nano -w /etc/fstabCode Listing 1.3: A full /etc/fstab example
/dev/sda2 /boot ext2 defaults,noatime 0 2 /dev/sda3 none swap sw 0 0 /dev/sda4 / ext4 noatime 0 1 /dev/cdrom /mnt/cdrom auto noauto,user 0 0 24.Setting the host name由于新的udev使用了新的命名规则,eth0现在是enp...的形式。# nano -w /etc/conf.d/hostname
25.Setting the domainname# nano -w /etc/conf.d/net (Set the dns_domain variable to your domain name) dns_domain_lo="homenetwork"Automatically obtaining an IP address for eth0添加config_eth0="dhcp" 添加routes_eth0="default via 192.168.1.1" (稍后会添加DHCP. )
使用下面方法改回eth0:
touch /etc/udev/rules.d/80-net-name-slot.rules
26.编辑hosts文件 Opening /etc/hosts# nano -w /etc/hosts
Code Listing 2.9: Filling in the networking information |
(This defines the current system) 127.0.0.1 tux.homenetwork tux localhost (Define extra systems on your network, they need to have a static IP to be defined this way.) 192.168.0.5 jenny.homenetwork jenny 192.168.0.6 benny.homenetwork benny |
Save and exit the editor to continue.
If you don't have PCMCIA, you can now continue with System Information. PCMCIA-users should read thefollowing topic on PCMCIA.
# cd /etc/init.d # ln -s net.lo net.eth0 # rc-update add net.eth0 default
If you have several network interfaces, you need to create the appropriatenet.* files just like you did with net.eth0.
If you later find out the assumption about the network interface name (which wecurrently document as eth0) was wrong, then
# nano -w /etc/rc.conf
当你完成对/etc/rc.conf的配置后,保存并退出。
正如你所看到的,为了帮助你完成必要变量的配置,这个文件有丰富的注释信息。你可以让你的系统使用unicode并定义你的默认编辑器和你的显示管理器(比如gdm或者kdm)。
30.config keymaps# nano -w /etc/conf.d/keymapsTake special care with the keymap variable. If you select the wrongkeymap, you will get weird results when typing on your keyboard.
When you're finished configuring /etc/conf.d/keymaps, save andexit.
Gentoo uses /etc/conf.d/hwclock to set clock options. Edit itaccording to your needs.
31.
Opening /etc/conf.d/hwclock |
# nano -w /etc/conf.d/hwclock |
If your hardware clock is not using UTC, you need to add clock="local"to the file. Otherwise you will notice some clock skew.
When you're finished configuring /etc/conf.d/hwclock, save andexit.
# emerge syslog-ng # rc-update add syslog-ng default
Gentoo offers several possible cron daemons, including bcron, dcron, fcron and cronie. Installing one of themis similar to installing a system logger. However, dcron andfcron require an extra configuration command, namely crontab/etc/crontab. If you don't know what to choose, use cronie.
Code Listing 2.1: Installing a cron daemon |
# emerge cronie # rc-update add cronie default (Only if you have chosen dcron or fcron) # crontab /etc/crontab |
If you want to index your system's files so you are able to quicklylocate them using the locate tool, you need to installsys-apps/mlocate.
Code Listing 3.1: Installing mlocate |
# emerge mlocate |
# rc-update add sshd default
# SERIAL CONSOLES s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100 s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100
# emerge dhcpcd
# emerge ppp
# emerge sys-boot/grub
# grub2-install /dev/sda
# grub2-mkconfig -o /boot/grub/grub.cfg Generating grub.cfg ... Found linux image: /boot/kernel-3.3.8-gentoo Found initrd image: /boot/initramfs-genkernel-x86-3.3.8-gentoo done上面方法应至少要找到一个linux system.
41.完成上面步聚后重启计算机。
42.安装KDE桌面
#emerge xorg-x11 or #emerge Xorg-server
修改make.conf:
VMware修改:
INPUT_DEVICES="evdev vmmouse"
VIDEO_CARDS="vmware"也可参考(http://forums.gentoo.org/viewtopic-t-885754-start-0.html):
这样:
Yikes. It looks like you have drivers for everything installed, which is not ... optimal, but I don't think it is your primary problem. Now you have to emerge those packages again, or at least the one for your hardware. We can get rid of the extraneous ones later if you want.
代码: |
eix -ICc x11-drivers | grep -v ^Found | awk '{print $2}' | xargs emerge -v1 |
代码: |
emerge -av1 x11-drivers/my-driver |
代码: |
cat /etc/make.conf lspci |
#emerge kdebase-meta
#startx