Gentoo安装详解(一)

前期准备远程登录:开启ssh服务:/etc/init.d/sshd start设置密码:passwd

以便使用putty、ssh client远程登录上传stage等(有时在线下载很慢,而局域网上传很快)

准备磁盘:分区:fdisk /dev/sda

/dev/sda1 : /boot 100M(32-100M) 设启动笔记-a /dev/sda2 : / 20G /dev/sda3 : /home 20G /dev/sda5 : /swap 1G (内存< 512 MB,分区分配2倍内存大小的空间;> 1024 MB,可以分配较少的空间甚至不需要swap 分区。)-t 82

创建文件系统:mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkfs.ext4 /dev/sda3mkswap /dev/sda5挂载分区:mount /dev/sda2 /mnt/gentoomkdir /mnt/gentoo/bootmount /dev/sda1 /mnt/gentoo/bootmkdir /mnt/gentoo/homemount /dev/sda3 /mnt/gentoo/homeswapon /dev/sda5安装系统安装stage及portage:正确设置日期/时间:date

如果显示的日期/时间不正确,可以使用date MMDDhhmmYYYY命令

下载Stage3 Tarbll:cd /mnt/gentoolinks .gentoo.org/main/en/mirrors.xml

选择国内速度较快的镜像,进入releases/x86/autobuilds/目录里。你将会看到所有适合你的计算机体系结构的stage文件(它们也可能放在各个独立的子体系名称的子目录里)。选择一个,然后按D来下载。下载完以后,再按Q退出浏览器。

或使用SSH Secure Shell登录上传stage3文件

解开Stage3 Tarball:tar xvjpf stage3-*.tar.bz2下载Portage:

打开links(或者lynx)然后到我们的Gentoo镜像列表。选择一个离你最近的镜像,打开snapshots/目录。然后选择最新的Portage快照(portage-latest.tar.bz2)并按D来下载它。

links .gentoo.org/main/en/mirrors.xml

或使用SSH Secure Shell登录上传portage文件

解压Portage:tar -xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr (install a Portage snapshot)编译前准备:配置编译选项:nano -w /mnt/gentoo/etc/portage/make.conf

CFLAGS=”-march=native -O2 -pipe” CXXFLAGS=”${CFLAGS}” # 两个变量使用相同的设置 MAKEOPTS=”-j3” #MAKEOPTS定义在安装软件的时候同时可以产生并行编译的数目,,CPU数目加一是个不错的选择

查看cpu信息:

cat proc/cpuinfo选择镜像站点:mirrorselect /mnt/gentoo/etc/portage/make.confmirrorselect /mnt/gentoo/etc/portage/make.conf 拷贝DNS信息:cp -L /etc/resolv.conf /mnt/gentoo/etc/Chroot进入新系统环境:Chroot:挂载 /proc, /dev, /sys文件系统:进入新的系统环境:chroot /mnt/gentoo /bin/bashsource /etc/profileexport PS1=”(chroot) $PS1″新环境配置:更新portage树:emerge –sync (Updating the Portage tree)或emerge-webrsync(fetch the latest portage snapshot)选择Profile:eselect profile listeselect profile set ×设置时区:ls /usr/share/zoneinfoecho “Europe/Brussels” > /etc/timezoneemerge –config sys-libs/timezone-data设置locale:nano -w /etc/locale.genlocale-gen更新环境变量:

“` env-update && source /etc/profile ““

莫找借口失败,只找理由成功。(不为失败找理由,要为成功找方法)

Gentoo安装详解(一)

相关文章:

你感兴趣的文章:

标签云: