Archlinux installation guide
https://wiki.archlinux.org/index.php/Installation_guide
Pre-installation
分區
$ fdisk /dev/sda
boot
> n
> return (default primary)
> return (default partition 1)
> return (default first sector)
> +250M
swap
> n
> return (default primary)
> return (default partition 2)
> return (default first sector)
> +2G
/
> n
> return (default primary)
> return (default partition 3)
> return (default first sector)
> +2G
> return
/home
> n
> p (make primary)
> return (default first sector)
> return (default last sector)
make /dev/sda1 bootable
> a
> 1
make /dev/sda1 to swap type partition
> t
> 2
> 82
write table to disk and exit fdisk
> w
格式化分區
format partitions
$ mkfs.ext4 /dev/sda1
$ mkfs.ext4 /dev/sda3
$ mkfs.ext4 /dev/sda4
make swap
$ mkswap /dev/sda2
mount swap
$ swapon /dev/sda2
加載分區
$ mount /dev/sda3 /mnt
$ cd /mnt
$ mkdir boot home
$ mount /dev/sda1 boot
$ mount /dev/sda4 home
$ cd /
安裝
檢測最快的鏡像地址
rankmirrors to make this faster (though it takes a while)
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig
rankmirrors -n 6 /etc/pacman.d/mirrorlist.orig \>/etc/pacman.d/mirrorlist
pacman -Syy
安裝系統
# install base packages (take a coffee break if you have slow internet)
pacstrap /mnt base base-devel
設置系統
Generate an fstab file
$ genfstab -p /mnt >> /mnt/etc/fstab
Change root into the new system
$ arch-chroot /mnt
Set the hostname
$ echo [archlinux] > /etc/hostname
Set the time zone
$ ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime
uncomment the needed locales in /etc/locale.gen
, then generate them with
$ locale-gen
Set locale preferences in /etc/locale.conf
and possibly $HOME/.config/locale.conf
$ echo LANG=en_US.UTF-8 > /etc/locale.conf
Set the root password (root account ,not your account, we will create that later)
$ passwd
安裝 bootloader
$ pacman -S grub-bios
$ grub-install /dev/sda
Create a new initial RAM disk
$ mkinitcpio -p linux
$ grub-mkconfig -o /boot/grub/grub.cfg
$ exit
卸載分區并重啟
$ umount /mnt/home
$ umount /mnt/boot
$ umout /mnt
$ reboot
Until not, we finish installing archlinux, then we are going to setup the system.
Post-installation
重啟后,需要手動獲取下 ip 地址
$ dhcpcd
每次系統啟動時,自動加載此命令
$ systemctl enable dhcpcd
允許安裝 32 位程序
$ vi /etc/pacman.conf
uncomment
[multilib](#)
Include = /etc/pacman.d/mirrorlist
update packages
$ pacman -Syy
$ pacman -Su
install x environment
$ pacman -S xorg-server xorg-xinit xorg-server-utils
intall mesa for 3d
$ pacman -S mesa
install virtualbox guest packages
$ pacman -S virtualbox-guest-utils
$ modprobe -a vboxguest vboxsf vboxvideo
create
$ vi /etc/modules-load.d/virtualbox.conf
add
vboxguest
vboxsf
vboxvideo
$ reboot
$ pacman -S xorg-twm xorg-xclock xterm
$ startx
create user to login
$ useradd -m -g users -G storage,power,wheel -s /bin/bash jma
$ passwd jma
$ visudo
allow user to run sudo
command
find
Uncomment to allow members of group wheel to execute any command
and uncomment
%wheel ALL=(ALL) ALL