Arch Linux Installation
Pre-Installation
According to Arch Linux wiki, in pre-installation state, after we boot it. We will have a virtual console as the root user, and presented with a Zsh shell.
After we get to the shell, the first command I normally type is
fdisk -lIt will show what size of your disk and also its name. For example: “/dev/sda/”. The sdX is the name of your disk, make sure the size is the one you want to install on it.
After we choose disks, sda for example here. I will type:
cfdisk /dev/sdacfdisk is a Linux partition editor, “dos” label type for UEFI and gpt is for a disk bigger than 2TB.
I will new a partition for boot. The size around 100M is enough, and don’t forget change it as bootable.
Another partition is swap. I will set it about 2G~4G and change it as Linux Swap.
For other space, whether you want to split a /home, /tmp or /var will be fine.
For the rest of space, just set it for the root.
After we finish, choose write and remember type yes in the console.
Since we got different partition of disk, we need to format each of it.
Example for following is “boot", “swap”, “root”.
mkfs.ext4 /dev/sda1mkswap /dev/sda2mkfs.ext4 /dev/sda3
and we mount swap to sda2,
swapon /dev/sda2mount the root partition,
mount /dev/sda3 /mntmake directory,
mkdir /mnt/boot /mnt/var /mnt/homemount boot partition,
mount /dev/sda1 /mnt/bootCheck the network: https://wiki.archlinux.org/index.php/Network_configuration_(%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87)
Install and update system:
pacstrap /mnt base base-develpacman -Syupacstrap /mnt grub-bios
Set fstab:
genfstab -p /mnt >> /mnt/etc/fstabChange root to the new system:
arch-chroot /mnt /bin/bashChange language:
nano /etc/locale.genSet system language:
locale-genecho LANG=en_US.UTF-8 > /etc/locale.confexport LANG=en_US.UTF-8
Set time zone:
ls /usr/share/zoneinform -rf /etc/localtimeln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtimehwclock — systohc — utc
Set hostname:
echo Username > /etc/hostnameEnable dhcp:
systemctl enable dhcpcd.serviceInstall and enable ssh:
pacman -S opensshsystemctl enable sshd.service
Set root password:
passwd rootAdd user:
useradd -m -g users -G wheel -s /bin/bash Userpasswd User
Set user’s limits of authority:
nano /etc/sudoersFinduser privilege specifcation
add following under root
User ALL=(ALL) ALL
Set grub:
grub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfgmkinitcpio -p linux
Exit and restart
exitumount /mnt/bootumount /mntreboot
Install desktop environment
xfce:
pacman -Sy xorgpacman -Sy xfce4 xfce4-goodiespacman -Sy ttf-freefontpacman -Sy lightdm lightdm-gtk-greetersystemctl enable lightdm.servicereboot

