Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
arch install usb firstpass future reference

useful links

find your device

lsblk
fdisk -l

wipe and make 1 partition (I didn't do GPT)

sudo fdisk /dev/sdb
 - o   create a new empty DOS partition table
 - p   print the partition table
 - n   add a new partition
    - use all defaults
 - a   toggle a bootable flag
    - use partition 1
- w   write table to disk and exit

put a new filesystem on it

# for non usb i'd use ext4
sudo mkfs.ext4 /dev/sdb1

mount usbstick in filesystem

mount /dev/sdb1 /mnt

update /etc/pacman.d/mirrorlist

curl https://www.archlinux.org/mirrorlist/?country=US&protocol=http&ip_version=4&use_mirror_status=on > /etc/pacman.d/mirrorlist

# uncomment the first few servers
vi /etc/pacman.d/mirrorlist

install base system

pacstrap -i /mnt base

generate fstab

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

# ensure fstab looks correct
# also add any extra options discard,noatime etc
vi /mnt/etc/fstab

time for some chroot

arch-chroot /mnt

setup locale

# uncomment en_US.UTF-8 UTF-8 (if that's what you're after)
vi /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

time/date/clock etc

ln -s /usr/share/zoneinfo/US/Central /etc/localtime
hwclock --systohc --utc
pacman -S ntp
ntpdate pool.ntp.org
systemctl enable ntpd.service

configure networking

# i use dhcp
systemctl enable dhcpcd.service
echo arch > /etc/hostname

bootloader (grub)

pacman -S grub
grub-install --recheck /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg

users

# set root pasword
passwd

pacman -S sudo

# add a user
useradd -m -g users grumpy
passwd grumpy

# potentially add grumpy to wheel
usermod -a -G wheel grumpy

# potentially allow wheel sudo access (uncomment out wheel)
visudo

configure package management

# uncomment the multilib lines if you need to install 32 bit stuff on a 64 bit installation
vi /etc/pacman.conf

# synchronize repository database and make any upgrades
pacman -Syu

pacman -S base-devel

# install aurget (aur helper)
# as user because is unsafe to run makepkg as root
su grumpy
cd
curl https://aur.archlinux.org/packages/au/aurget/aurget.tar.gz > aurget.tar.gz
tar -xzvf aurget.tar.gz
cd aurget
makepkg
sudo pacman -U ./aurget-[version].pkg.tar.xz
mkdir ~/.config
cp aurgetrc ~/.config/

# i move build_directory to /tmp/aurget
vi ~/.config/aurgetrc

# clean up
cd
rm -rf aurget*

# and back to root
exit

install some extra stuffs

pacman -S vim

# ssh
pacman -S openssh
vi /etc/ssh/sshd_config
systemctl enable sshd.service

pacman -S tmux

finish up

# leave chroot
exit

# unount the drive
umount /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.