gentoo 安装 (how to install gentoo quickly)

一剑行天下 posted @ 2010年7月20日 00:18 in 学习 , 5325 阅读

 

1 配置网络 	自动配置命令 net-setup;
	实验室应用dhcp即服务器自动获取IP,配置手动 ifconfig eth0或1 测试可用网卡,查询到可用网卡对其执行 dhcpcd eth0,
无线网络暂且略过。
	可选:手动配置网络, ifconfig eth0 ${IP地址} broadcast ${广播} netmask ${子网掩码} up; 
实验室用:ifconfig eth0 $192.168.0.(88) broadcast $192.168.0.255 netmask $255.255.255.0
			     route add default gw ${网关}      实验室:192.168.0.1

2 准备磁盘
	fdisk /dev/ada 启动fdisk
	p 显示当前分区
	d 删除
	n 新建 然后选择 e 格式, 用 +100M 来确定分的区域大小,直接回车是把剩余所有分配 
	a 给分区添加启动标志
	w 保存退出
	

	创建文件系统
		各种硬盘格式化格式有不同命令
		实验室:可全用 ext3 格式化 命令:mke2fs -j /dev/sda1

	然后挂载这些分区
	mount /dev/sda3 /mnt/gentoo  	
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
(这些仍在磁盘上) 3 安装gentoo环境文件 设置日期和时间 查看命令:date 设置则为 date 071909492010 格式:月-日-小时-分钟-年份 下载stage3的包 进入/mnt/gentoo links http:... 进入网络 下载。。。。 md5验证命令:md5sum -c 文件名.DIGESTS 解压stage3包:tar xvjpf stage3-*.tar.bz2 (x表示解开,v表示详细信息,j表示使用bzip2解压缩, p表示保留权限,f表示我们要解开一个文件,而不是标准输入) 安装portage cd /mnt/gentoo links http:.... md5sum -c .... tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/ (注意解压参数和-C) 配置编辑选项即make.conf中内容 nano -w /mnt/gentoo/etc/make.conf 可以直接拷贝现成的 4 安装gentoo基本系统 进入新环境前,拷贝网络DNS信息 cp -L /etc/resolv.conf /mnt/gentoo/etc/ (注意参数-L) 挂在/proc和/dev文件系统 mount -t proc none /mnt/gentoo/proc mount -o bind /dev /mnt/gentoo/dev 进入新的系统环境 chroot /mnt/gentoo /bin/bash env-update (建立新环境,变量) source /etc/profile (加载这些变量) export PS1="(chroot) $PS1" 配置portage 更新portage树到最新版本,emerge --sync 选择正确的profile 验证系统profile:eselect profile list (选用default/linux/x86/10.0项) 可以通过命令切换:eselect profile set 2 配置USE make.conf 文件中的信息 配置字体, nano -w /etc/locale.gen 字符集格式 一般为en_US ISO-8859-1 en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GB2312 GB2312 zh_CN.GB18030 GB18030 zh_CN.GBK GBK 然后执行命令locale-gen,它会产生所有你在/etc/locale.gen文件里指定的locale 记得locale-gen,若忘记则需要在系统安装完后执行该命令在重新编辑glibs文件,即emerge -avt glibs 5 配置内核 时区 ls /usr/share/zoneinfo (可选时区在这个文件夹下) cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 选择当地时区 安装源码 emerge gentoo-sources (有的拷贝文件make.conf中USE项限制了perl、python、ruby, 需要先去掉才可以安装gentoo-sources) ls -l /usr/src/linux 查看使用的内核,指向 cd /usr/src/linux 进入该文件夹 make menuconfig 编辑内核配置菜单 file systems --->pseudo filesystems ---> 实验室:选择机器选择core2/newer xeon项(实体机),  虚拟机用pentium-proewer xeon项(实体机), 虚拟机用pentium-pro项 等等项 编辑与安装 make && make modules_install 复制内核(conf文件)到/boot,可以任意命名,需记住,配置引导程序grub时需要用到。 xp arch/x86(根据上面的信息可确定)/boot/bzImage /boot/kernel-2.6.34-gentoo-r2 6 配置系统 nano -w /etc/fstab 文件系统信息 fstab文件 /dev/sda7(启动目录) /boot ext3 defaults,noatime 1 2 /dev/sda8(根目录) / ext3 noatime 0 1 proc /proc proc defaults 0 0 shm /dev/shm     tmpfs     nodev,nosuid,noexec 0 0 网络信息 nano -w /etc/conf.d/hostname 可修改超级用户名字 nano -w /etc/conf.d/net 编辑配置网络,实验室用:config_eth0=( "dhcp" ) (记得后续操作要安装dhcpcd) 手动设置为config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" ) routes_eth0=( "default via 192.168.0.1" ) 添加net.eth0到默认的运行级别 rc-update add net.eth0 default 多个时 cd /etc/init.d ln -s net.lo net.eth1 rc-update add net.eth1 dafault 设置超级用户root的密码 passwd 系统信息 可查看以下 nano -w /etc/rc.conf nano -w /etc/conf.d/keymaps nano -w /etc/conf.d/clock (其中机器用时不用UTC,需要把文件中加上CLOCK="local"。否则时间可能会出错。 7 安装必要的系统工具 网络工具:emerge dhcpcd 8 配置引导程序 emerge grub 默认为0.97版,实验室可支持1.98版,需要改动,/etc/portage/package.keywords(没有自己创建),加入sys-boot/grub **, 表示grub支持**关键字,另外需在/etc/portage/package.mask中把最新的不稳定版屏蔽掉,加入>=sys-boot/grub-9999即可。 新的grub生成的为grub.cfg文件。内容可如下配置: menuentry "Gentoo GNU/Linux, with Linux 2.6.34-gentoo-r2" --class gentoo --class gnu-linux --class gnu --class os { insmod ext3 set root='(hd0,7)' search --no-floppy --fs-uuid --set 1485fc01-ccfe-49b2-a058-b653dfdcf3ac echo Loading Linux 2.6.34-gentoo-r2 ... linux /kernel-2.6.34-gentoo-r2 root=/dev/sda8 ro quiet } menuentry "Gentoo GNU/Linux, with Linux 2.6.34-gentoo-r1 (recovery mode)" --class gentoo --class gnu-linux --class gnu --class os { insmod ext3 set root='(hd0,7)' (即为分区号,在老的里面还为分区号-1) search --no-floppy --fs-uuid --set 1485fc01-ccfe-49b2-a058-b653dfdcf3ac echo Loading Linux 2.6.34-gentoo-r1 ... linux /kernel-2.6.34-gentoo-r1 root=/dev/sda8 ro single } menuentry "Win 7" { set root=(hd0,1) chainloader +1 } 需要执行grub-install --no-floppy /dev/sda 然后可以退出chroot exit cd umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo reboot重启取盘 9 结束gentoo安装 添加用户:useradd -m -G users,wheel,audio -s /bin/bash 名字 passwd 名称 磁盘清理:删除stage3和portage包,从网上下的。 继续进行 emerge -e system emerge -e world 清理底层库,以便重新编辑遍 etc-update 然后选择-5 env-update source /etc/profile emerge --sync emerge -uDNa world 升级 开机启动项:rc-update add hald default 添加 可以安装gnome echo "gnome-base/gnome-session branding" >> /etc/portage/package.use 启动gentoo品牌 emerge -avt gnome-light 最大化安装 env-update && source /etc/profile 启动:/etc/init.d/hald start rc-update add hald default /etc/init.d/dbus start rc-update add dbus default 设定gnome为默认桌面环境,配置~/.xinitrc文件 export XDG_MENU_PREFIX="gnome-" export XMODIFIERS="@im=ibus" export GTK_IM_MODULE="ibus" export QT_IM_MODULE="ibus" exec gnome-session 有时需要配置X文件 emerge xorg-server env-update source /etc/profile 自动创建 xorg.conf:Xorg -configure 拷贝:cp /root/xorg.conf.new /etc/X11/xorg.conf 可以startx开启桌面了 补充: emgerge -C 包:删除包 eix -e gcc:当准确知道包的名字时,可使用查找,只显示gcc eix -s ..:关键词查找 sudo eix-update:更新eix索引 equery:查找包依赖文件,equery d gtk+:查找依赖gtk+的包 更新镜像列表后需: su visudo 把其中%wheel。。这一行的注释符号去掉,即打开它。 可以groups pub 查看 最新包试用 安装软件包layman cd /var/lib/portage sudo layman -L 包名:查看 -a 包名:下载 -d 包名:删除 开启此项时,下载包以此为优先,在考虑官方包。 升级流程 emerge --sync (同步库) emerge -uDNa world (升级) emerge --depclean (清理包) revdep -rbuild (回复一些depclean中误删的有用包) /etc/portage/package.use 内容:安装文件 支持的功能/-表示不支持此功能 app-text/xournal pdf:表示xournal支持pdf功能 /etc/portage/package.keyword 内容:文件名 ** 表示该软件包支持**关键字 euse -I 包名:解释包的信息 更新内核: eselect kernel list:查看内核情况 cd /usr/src ln -sfn linux-2.6.34-gentoo-r2 linux:更改linux符号链接 cd /usr/src/linux make menuconfig (手工配置,或者可以拷贝以前的.config进来,在运行此命令,直接退出,保存) make && make modules_install mount /boot cp arch/x86/boot/bzImage /boot/kernel-2.6.34-gntoo-r2 (拷贝内核信息到boot) 修改grub 如更改后不能进入桌面,需重新编辑显卡,emerge -avt nvidia-drivers eselect opengl list:查看显卡选项,用的X11还是nvidia eselect opengl set 1:切换,选择1 vbox不能自动setup解决方案: /etc/conf.d/modules 中添加行:modules_2_6 = " vboxdrv "(_2_6表示系统内核版本,可用命令uname -r查看) 安装firefox emerge -avt mozilla-firefox 安装中文字体 emerge -avt ibus emerge -avt ibus-pinyin 安装完之后在property中启动ibus添加pingyin选项 安装终端右击 emerge -avt nautilus-open-terminal 查询软件包 eix dhcpcd(软件包) 更改分辨率:sudo nvidia-settings 断开m2网络:sudo /etc/init.d/NetworkManager restart/up/stop rc-update show mke2fs /dev/sda1 格式化硬盘 ext2 mke2fs -j /dev/sda1 格式化硬盘 ext3 git clone m2@192.168.0.2:~/project/m2boxtree.git 拷贝东西 scp kang@192.168.0.50:~.xinitrc /文件目录 ssh协议
/etc/X11/xorg.conf (X的配置文件)目录下的
xorg.conf 内容为:
Section "Device"
Identifier "Card0"
Driver "nvidia"
VendorName "nVidia Corporation"
BoardName "G92 [Quadro FX 3700]"
BusID "PCI:96:0:0"
EndSection  
删除了多余的内容 (解决了向上键不管用的问题
用户设置
useradd -m -G kang
useradd -m -G wheel kang (把用户加入
wheel就可以使用sudo了

 

Avatar_small
呵呵 说:
2011年2月17日 08:32

这个真不错!

Avatar_small
KVS 2nd Class Model 说:
2022年9月27日 20:50

Every year the Kendriya Vidyalaya Sangathan Subject experts are provided those practice model question bank to their students for practicing subject most important questions of Term-1, Term-2, Term-3, KVS 2nd Class Model Paper Term-4 exams along with school-level exams at all regions of the country, and this year also provided the KVS 2nd Class Model Paper 2023 with Suggested Answer Solutions to all subjects in Chapter wise to every lesson. Every year the Kendriya Vidyalaya Sangathan Subject experts are provided those practice model question bank to their students for practicing subject most important questions of Term-1, Term-2.

Avatar_small
civaget 说:
2023年12月11日 00:20

백링크업체's SEO audits are thorough and insightful. They helped me understand my site's weaknesses and strengths.

Avatar_small
civaget 说:
2023年12月13日 18:58

Exploring 제주유흥 was a revelation. The mobile massage services were exceptional.

Avatar_small
civaget 说:
2023年12月14日 20:16

부천출장마사지is a game-changer for self-care and relaxation.

Avatar_small
civaget 说:
2023年12月16日 12:54

Great work! This is the kind of info that should be shared around the internet. Shame on Google for now not positioning this submit higher! Come on over and discuss with my web site . Thanks =) NBA중계

Avatar_small
civaget 说:
2023年12月16日 19:17

The content diversity on 누누티비 ensures I never run out of things to watch.

Avatar_small
civaget 说:
2023年12月20日 17:37

After my 러시아마사지, I felt like a new person. Stress-free and energized!

Avatar_small
civaget 说:
2023年12月20日 17:52

For thorough and reliable 설문조사 사이트 추천, choose Tipping.

Avatar_small
civaget 说:
2023年12月27日 04:12

It's amazing how technology has made self-publishing accessible to anyone with a story to tell. self publish

Avatar_small
civaget 说:
2023年12月27日 15:55

Subsequently, after spending many hours on the internet at last We’ve uncovered an individual that definitely does know what they are discussing many thanks a great deal wonderful post 프리카지노

Avatar_small
civaget 说:
2023年12月27日 21:53

I rely on 축구중계 for my soccer fix, whether it's live matches or on-demand highlights.

Avatar_small
civaget 说:
2024年1月07日 15:27

누누티비's user-friendly interface makes it easy to find and enjoy my favorite shows.

Avatar_small
civaget 说:
2024年1月14日 23:24

I must examine with you here. Which isn’t one thing I often do! I get pleasure from reading a post that may make individuals think. Also, thanks for permitting me to remark! เว็บพนันออนไลน์ คืนยอดเสีย

Avatar_small
civaget 说:
2024年1月15日 21:23

Playing baccarat on 안전한 바카라 사이트 is a delightful experience.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter