Arch Linux Installation

Pre-Installation

Wei zen Liu
Sep 8, 2018 · 2 min read

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 -l

It 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/sda

cfdisk 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/sda2

mount the root partition,

mount /dev/sda3 /mnt

make directory,

mkdir /mnt/boot /mnt/var /mnt/home

mount boot partition,

mount /dev/sda1 /mnt/boot

Check 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/fstab

Change root to the new system:

arch-chroot /mnt /bin/bash

Change language:

nano /etc/locale.gen

Set 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/hostname

Enable dhcp:

systemctl enable dhcpcd.service

Install and enable ssh:

pacman -S opensshsystemctl enable sshd.service

Set root password:

passwd root

Add user:

useradd -m -g users -G wheel -s /bin/bash Userpasswd User

Set user’s limits of authority:

nano /etc/sudoers

Finduser 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

北科理組文青蘿莉控’s 筆記空間

Data Engineering and Storage Lab, NTUT EE && QA, BOSCH

Wei zen Liu

Written by

Front-end developer / Mobile application developer, Study in NTUT. Skills: Html / SCSS / Javascript(es6) / gulp.js / Vue.js / Git / bash / linux / C / C++ /

北科理組文青蘿莉控’s 筆記空間

Data Engineering and Storage Lab, NTUT EE && QA, BOSCH

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade