Skip to content

Instantly share code, notes, and snippets.

@dm4
Forked from xatier/Arch_install.md
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dm4/94094b3f7fa790c3232c to your computer and use it in GitHub Desktop.
Save dm4/94094b3f7fa790c3232c to your computer and use it in GitHub Desktop.

Archlinux installation

Ref.

Arch's official guide

pf's note (too old)


After booting from a USB stick, you'll get a zsh root shell

check for networking

  • ping google
# ping google.com

network settings

dhcp

  • the DHCP client daemon was started automatically

public ip

  • use dhcpcd -k or systemctl stop dhcpcd.service first to disable DHCP networking

  • use ip command and resolv.conf

# ip link                       # interface, something like 'eth0' or 'enp2s0'
# ip link set <if> up
# ip addr add <ip address>/<subnetmask> dev <if>
# ip route add default via <gateway's ip address>

# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
search foo.bar.com

wireless

  • remember to install netctl after chroot, otherwise the network will be broken after rebooting
# iw dev
# wifi-menu

partition table

  • check for old partitions first
# fdisk -l
  • Destroy the whole world
# cfdisk /dev/sda

=================================
An example for creating  partition tabel
/         25G      /dev/sda1
swap      1G       /dev/sda2
/home     else     /dev/sda3
  • format partitions (ext4)
# mkfs.ext4 /dev/sda1 
# mkfs.ext4 /dev/sda3
  • swap
# mkswap /dev/sda2 && swapon /dev/sda2
  • check all things done well
# lsblk /dev/sda

mount root and home

# mount /dev/sda1 /mnt
# mkdir /mnt/home && mount /dev/sda3 /mnt/home

select a mirror

  • choose nctu or tku in Taiwan
# vi /etc/pacman.d/mirrorlist

pacstrap

  • base system
# pacstrap /mnt base base-devel
  • if the keylist is out-of-date
# pacman -S archlinux-keyring
# pacman-key --init && pacman-key --populate archlinux

generate fstab

# genfstab -U -p /mnt >> /mnt/etc/fstab
# cat /mnt/etc/fstab
  • edit /mnt/etc/fstab and add discard,noatime if you're using SSD

chroooooooooot!

# arch-chroot /mnt /bin/bash
# . /etc/profile 
# PS1="(chroot) $PS1"

locale settings

  • remove comments for your locale
# vi /etc/locale.gen
en_US.UTF-8 UTF-8
en_US ISO-8859-1
zh_TW.UTF-8 UTF-8
# locale-gen
# locale
# echo "LANG=en_US.UTF-8" > /etc/locale.conf

timezone and hwclock

# ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime 
# hwclock --systohc --utc

hostname

  • set hostname
# echo hostname > /etc/hostname
  • add your hostname in /etc/hosts
# vi /etc/hosts

network configurations

dhcpcd

# systemctl enable dhcpcd@interface.service

static ip config

# cd /etc/netctl
# cp examples/ethernet-static .
# vi ethernet-static
=> fill your {ADDR, GATEWAY, DNS}
=> remove the comment # of IP6=stateless
dns search domain
=> DNS SEARCH='foo.bar.com'


# netctl enable ethernet-static

wireless

  • note: dialog is required by `wifi-menu
# pacman -S iw wpa_supplicant dialog
  • you also can use netctl for your wireless networking
# cd /etc/netctl
# cp examples/wireless-wpa .`
# vi wireless-wpa
# netctl enable wireless-wpa

generate initial ramdisk environment

# mkinitcpio -p linux
  • note: you might take a look of /etc/mkinitcpio.conf and add some HOOKS probably

root passwd and add user

# passwd
# useradd -m xatier
# passwd xatier

grub

# pacman -S grub os-prober
# grub-install --target=i386-pc --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg

AUR

  • add yaourt for pacman.conf
# vi /etc/pacman.conf
[archlinuxfr]
SigLevel = Optional
Server = http://repo.archlinux.fr/$arch
  • update pacman
# pacman -Syu

bye bye chroot

## exit 

unmount everything

# umount /mnt/{home,}

reboot

# reboot

well done for base system!


post installation

become God

# su -

install some tools

# pacman -S openssh vim sudo screen tmux htop rsync git acpi

add a sudoer

# visudo

bash complete for sudo

$ complete -cf sudo

VirtualBox

X window

$ sudo pacman -S alsa-utils xorg-server xorg-xinit xorg-utils xorg-server-utils mesa [xf86-video-intel xf86-video-ati xf86-video-nouveau xf86-video-vmware] xf86-input-synaptics ttf-dejavu

awesome wm

$ sudo pacman -S awesome

$ vim ~/.xinitrc
exec awesome >> ~/.cache/awesome_stdout 2>> ~/.cache/awesome_stderr 

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment