選擇安裝方式
CD/USB Arch啟動盤安裝
使用Arch啟動盤比較簡單方便,沒有額外設(shè)置,直接閱讀下一步。
USB flash installation media
啟動盤制作: USB flash installation media
從已經(jīng)存在的Linux系統(tǒng)中安裝(非Arch類)
從已經(jīng)存在的非Arch系統(tǒng)環(huán)境中安裝arch,本質(zhì)上是搭建引導(dǎo)過程中可以運行arch-install-scripts
腳本(包括pacstrap
和arch-chroot
命令) 的系統(tǒng)環(huán)境。
- 創(chuàng)建Arch chroot環(huán)境
1、推薦使用bootstrap
鏡像
### Download the bootstrap image from a mirror:
[root@GENTOO ~] curl -O http://mirrors.kernel.org/archlinux/iso/2015.10.01/archlinux-bootstrap-2015.10.01-x86_64.tar.gz
### Extract the tarball:
[root@GENTOO ~] cd /tmp# tar xzf <path-to-bootstrap-image>/archlinux-bootstrap-2015.10.01-x86_64.tar.gz
2、編輯/tmp/root.x86_64/etc/pacman.d/mirrorlist
本件,選擇鏡像源
3、進入chroot環(huán)境
/tmp/root.x86_64/bin/arch-chroot /tmp/root.x86_64/
- 使用Arch chroot環(huán)境
1、初始化pacman keyring
# pacman-key --init
# pacman-key --populate archlinux
2、編輯/etc/pacman.d/mirrorlist
本件,選擇鏡像源
3、更新軟件列表
# pacman -Syyu
4、安裝系統(tǒng)
Arch Chroot環(huán)境已經(jīng)具備,繼續(xù)下面的步驟,選擇安裝需要的系統(tǒng)base
, base-devel
, parted
等.
參考:https://wiki.archlinux.org/index.php/Install_from_existing_Linux
準備
準備磁盤分區(qū)
- 新建并格式化分區(qū)
至少準備一個足夠大的/分區(qū),如果磁盤容量足夠,可以額外創(chuàng)建/home、/boot等。
- 創(chuàng)建掛載目錄
mkdir /mnt
mkdir /mnt/boot
mkdir /mnt/home
- 掛載根分區(qū)和swap
Mount the root partition on /mnt. After that, create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and activate your swap partition if you want them to be detected later by genfstab.
mount /dev/sdax /mnt
mount /dev/sdax/boot
mount /dev/sdax/home
準備連接
- 有線:
默認使用Dhcp,一般自動檢測,無需設(shè)置
- 無線:
wifi-menu
- 編輯鏡像列表
wget -O /etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/
取消注釋中國的鏡像
安裝系統(tǒng)
pacstrap /mnt base
配置系統(tǒng)
fstab文件
- Generate an fstab file (use -U or -L to define by UUID or labels):
genfstab -p /mnt >> /mnt/etc/fstab
chroot
arch-chroot /mnt
Hostname:
echo computer_name > /etc/hostname
Time zone:
ln -sf /usr/share/zoneinfo/zone/subzone /etc/localtime
Locale:
nano -w /etc/locale.gen
locale-gen
Password:
passwd
Initial RAM:
mkinitcpio -p linux
Bootloader:
- 安裝grub2:
pacman -S grub
grub-install --target=i386-pc --recheck /dev/sda
- Dual-booting:
pacman -S os-prober
- 生成grub配置文件
grub-mkconfig -o /boot/grub/grub.cfg
重啟
exit
reboot