Skip to content

Instantly share code, notes, and snippets.

@haishanh
Created August 2, 2016 05:15
Show Gist options
  • Save haishanh/0e724a49094d8792bc1e8b5bbbac03d5 to your computer and use it in GitHub Desktop.
Save haishanh/0e724a49094d8792bc1e8b5bbbac03d5 to your computer and use it in GitHub Desktop.
archlinux install

Install archlinux

Set the keybord layout

Connect to the internet

Update the system clock

timedatectl set-ntp true

Partition

See detail

Indentify the device and partition, don't forget to mark bootable.

lsblk
fdisk xxx

Formating

lsblk /dev/sdx
mkfs.ext4 /dev/sdxy

# if there is swap partition
mkswap /dev/sdxy
swapon /dev/sdxy

Mount the partitions

mount /dev/sdxy /mnt

# if there is a /boot partition
mkdir -p /mnt/boot
mout /dev/sdxy /mnt/boot

Installation

Select the mirros in /ect/pacman.d/mirrorlist

Install the base packages

pacstrap -i /mnt base base-devel

Configuration

Genrate the fstab file

genfstab -U /mnt >> /mnt/etc/fstab

chroot

arch-chroot /mnt /bin/bash

Locale

# uncomment `en_US.UTF-8`
vi /etc/locale.gen

locale-gen

# add `LANG=en_US.UTF-8`
vi /etc/locale.conf

Time

tzselect

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

hwclock --systohc --utc

Initramfs

mkinitcpio -p linux

Boot loader

Install grub

pacman -S grub

Install boot files to disk

grub-install --target=i386-pc /dev/sdx
grub-mkconfig -o /boot/grub/grub.cfg

see also arch wiki grub

Network config

Root password

passwd

Ummout the partitions and reboot

Ctrl + D to exist the chroot environment

Then

umount -R /mnt
reboot

Post installation

pacman -S vim openssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment