快速安装方法见Gentoo Linux 快速安装方法安装不过本人没有安装成功,可能是光驱有点问题。
gentoo linux有几种安装方法,下面使用官方最小安装的方法。安装成功。
1.1首先下载gentoo最小安装光盘,下载地址http://mirrors.sohu.com/gentoo/releases/x86/current-stage3/install-x86-minimal-20111129.iso
1.2. 利用UltraISO来刻录镜像
1.3. 插入U盘
1.4. 用UltralISO打开iso文件
1.5. 选择启动 -> 写入硬盘镜像
1.6. 格式化U盘,再点写入
1.7. 在BIOS中选择从USB启动之后就可以用U盘启动系统,进行安装了。
gentoo nox
使用fdisk或cfdisk磁盘管理工具对磁盘分区。
这里本人对磁盘分区如下:
设备 大小 挂载点
/dev/sda1 30G NFTS
/dev/sda2 300M /boot
/dev/sda3 60G /
/dev/sda5 2G swap
/dev/sda6 60G /home
fdisk详细使用如下,摘自官方文档Gentoo安装过程中fdisk的使用
mount /dev/sda3 /mnt/gentoo/ mount /dev/sda2 /mnt/gentoo/boot mount /dev/sda6 /mnt/gentoo/home
cd /mnt/gentoo然后使用
wget http://mirrors.sohu.com/gentoo/releases/x86/current-stage3/stage3-i686-20111129.tar.bz2或者使用links命令,点击对应的链接进行下载。(之前得配置网络:使用 net-setup eth0 )
解压
tar xvjpf stage*
和上面一样,下载http://mirrors.sohu.com/gentoo/snapshots/portage-latest.tar.bz2
并解压到/mnt/gentoo/usr/下
打开make.conf文件
nano -w /mnt/gentoo/etc/make.conf
CFLAGS="-O2 -march=nocona -pipe" # 两个变量使用相同的设置 CXXFLAGS="${CFLAGS}" CHOST="i686-pc-linux-gnu" MAKEOPTS="-j3" USE="-gtk -gnome3 qt3qt4 kde alsa cdr" GENTOO_MIRRORS="http://mirrors.sohu.com/gentoo"
# cp -L /etc/resolv.conf /mnt/gentoo/etc/ # mount -t proc none /mnt/gentoo/proc # mount -o bind /dev /mnt/gentoo/dev
# chroot /mnt/gentoo /bin/bash # env-update >> Regenerating /etc/ld.so.cache... # source /etc/profile # export PS1="(chroot) $PS1"
emerge --sync
# eselect profile list # eselect profile set n
# nano -w /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
emerge gentoo-sources
make menuconfig
make && make modules_install
cp arch/x86/boot/bzImage /boot/kernel-3.0.6-gentoo注意修改内核的名字对应自己的内核版本
# /etc/fstab: static file system information. # # noatime turns off atimes for increased performance (atimes normally aren't # needed); notail increases performance of ReiserFS (at the expense of storage # efficiency). It's safe to drop the noatime options if you want and to # switch between notail / tail freely. # # The root filesystem should have a pass number of either 0 or 1. # All other filesystems should have a pass number of 0 or greater than 1. # # See the manpage fstab(5) for more information. # # <fs> <mountpoint> <type> <opts> <dump/pass> # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. /dev/sda2 /boot ext3 defaults,noatime 1 2 /dev/sda3 / ext3 noatime 1 1 /dev/sda5 none swap sw 0 0 /dev/sda6 /home ext3 defaults,noatime 1 2 /dev/cdrom /mnt/cdrom auto noauto,ro 0 0
# nano -w /etc/conf.d/hostname (将HOSTNAME的变量值设定为主机名) HOSTNAME="yan-laptop"
# nano -w /etc/conf.d/net (设定dns_domain的变量值为你的域名) dns_domain_lo="homenetwork" config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" ) routes_eth0=( "default via 192.168.0.1" ) config_eth0=( "dhcp" )
# cd /etc/init.d # ln -s net.lo net.eth0 # rc-update add net.eth0 default
# nano -w /etc/hosts
127.0.0.1 localhost yan-laptop
emerge dhcpcd
emerge grub -av
nano -w /etc/boot/grub/grub.conf文件内容如下:
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook # http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2 # If you are not using Genkernel and you need help creating this file, you # should consult the handbook. Alternatively, consult the grub.conf.sample that # is included with the Grub documentation. default 0 timeout 5 #splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Gentoo Linux 3.0.6 root (hd0,1) kernel /boot/kernel-3.0.6-gentoo root=/dev/sda3 title Windows 7 rootnoverify(hd0,0) makeactive chainloader +1 # vim:ft=conf:
grep -v rootfs /proc/mounts > /etc/mtab
grub-install --no-floppy /dev/sda
有空将KDE桌面装上。不过编译得有一天的时间。这就是Gentoo的特点,高度的定制性,才能获得高的效率。这就是Gentoo的Philosopy。
后记:
由于最近新换了电脑,为了享受Gentoo的编译速度,特地买了四核主机,重新安装了Gentoo。
我的分区信息如下:
Device Boot Start End Blocks Id System /dev/sda1 63 106496062 53248000 7 HPFS/NTFS/exFAT /dev/sda2 * 106498048 107112447 307200 83 Linux /dev/sda3 107112448 149055487 20971520 83 Linux /dev/sda4 149055488 976773167 413858840 5 Extended /dev/sda5 149057536 295858175 73400320 83 Linux /dev/sda6 295860224 316831743 10485760 83 Linux /dev/sda7 316833792 327319551 5242880 83 Linux /dev/sda8 327321600 335710207 4194304 82 Linux swap / Solaris /dev/sda9 335712256 765628415 214958080 83 Linux /dev/sda10 765630464 976773167 105571352 7 HPFS/NTFS/exFAT
/dev/sda2 /boot ext3 defaults,noatime 1 2 /dev/sda3 / ext3 defaults 1 0 /dev/sda5 /usr ext3 defaults 1 0 /dev/sda6 /var ext3 defaults 1 0 /dev/sda7 /tmp ext3 defaults 1 0 /dev/sda8 none swap sw 0 0 /dev/sda9 /home ext3 defaults 1 0
# When compiler flags are unset, many packages will substitute their own # implicit flags. For uniformity, use an empty string as the default. CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" SYNC="rsync://mirrors.163.com/gentoo-portage" GENTOO_MIRRORS="http://mirrors.163.com/gentoo" USE="gnome X dbus v4l v4l2 qt3 qt4 gtk -laptop samba bindist -kde -arts consolekit policykit udev alsa -cdr -cups bluetooth" LINGUAS="en_US en en_GB uk zh zh_CN" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="-j5"