博主linux小白一个,一直想试试archlinux,最近终于有时间了,一番努力之后成功了,写出来与大家分享。
archlinux版本 2013.06.01.
archlinux的优点就不说了,百度之流的都写得很详细了,我觉得最大的优点就是简洁,不过也太简洁了。。。连个图形界面的安装都没有。
步入正题,这是我的参考文档。
https://wiki.archlinux.org/index.php/Beginners%27_Guide_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29
大体上可以按着他的教程一步一步来,不过可能由于是在虚拟机中安装,好多地方需要改变下。
1、下载镜像后,新建个虚拟机,以镜像启动。
2、语言什么的就不用管了,默认的都是对的。
3、关于网络,因为是虚拟机,所以现在不用配置,但是后面是必需配置的。
4、硬盘分区,这步比较重要,虚拟机的硬盘好像不大一样。建议将“/”和“/home”分成两个区,分区按照他的来就行。
MBR | cfdisk /dev/sda | Root:
|
Home:
| ||
GPT | cgdisk /dev/sda | Root:
|
Home:
|
5、硬盘格式化,他给的命令好像虚拟机硬盘不支持,所以
# mkfs -t ext2 /dev/sda1
# mkfs -t ext2 /dev/sda2
6、挂载分区,这个没问题。
# lsblk /dev/sda
# mount /dev/sda1 /mnt
# mkdir /mnt/home
# mount /dev/sda2 /mnt/home
7、选择安装镜像,这步不建议改,博主就换了个学校的源,但是不是官方的,而且好像少了什么东西,然后签名不通过,总之不能用。
8、安装基本系统也是没问题的。
# pacstrap /mnt base base-devel
# pacman-key --init && pacman-key --populate archlinux
9、生成fstab,fstab是linux启动过程中的硬盘分区表,随眼他说都行,但是博主测试只能用标签选项
# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab
10、Chroot到新系统。前面正确的话,这步就可以切换到安装的系统了。
# arch-chroot /mnt
11、配置系统,这里的都没问题。
nano /etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
# locale-gen
nano /etc/locale.conf
LANG=zh_CN.UTF-8
LC_TIME=en_GB.UTF-8
nano /etc/vconsole.conf
KEYMAP=us
FONT=
# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc --utc
nano /etc/modules-load.d/virtio-net.conf
# Load virtio-net.ko at boot
virtio-net
# echo myhostname > /etc/hostname
12、配置网络,这里不可以省略了。由于是虚拟机,所以
# systemctl enable dhcpcd@eth0.service
# cd /etc/netctl
# cp examples/ethernet-dhcp my-network
# nano my-network
# netctl enable my-network
13、设置root密码
# passwd
14、安装启动器,网上说可能遇到各种问题,我运气好,啥都没遇到。。
# pacman -S grub-bios
# grub-install --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
15、卸载分区,重启系统。
# exit
# umount /mnt/{boot,home,}
# reboot
到此为止,你就有了一个可以在虚拟机里用的archlinux了。