Skip to content

Instantly share code, notes, and snippets.

@shpark
Last active March 29, 2021 04:22
Show Gist options
  • Save shpark/82ae27a0c7c834dda98f266ef66a01ab to your computer and use it in GitHub Desktop.
Save shpark/82ae27a0c7c834dda98f266ef66a01ab to your computer and use it in GitHub Desktop.
Arch Linux installation and setup trouble shootings

Arch Linux installation and setup trouble shootings

Network Configuartion

Here are the summary of how to connect to the network (wireless/ethernet) during the installation.

Wireless

This link provides good explanation on how to connect to a WPA/WPA2 Wi-Fi network.

  1. Setup the wireless device
# ip link set wlan0 up

FYI, you can find the interface name of your wireless device using iw dev command.

  1. Scan available Wi-Fi networks
# iw wlan0 scan | less

From the above command, you will get #ssid of the Wi-Fi network that you'd like to connect.

  1. Connect to wpa/wpa2 Wi-Fi network
# wpa_passphrase $ssid >> /etc/wpa_supplicant.conf
(type the passphrase)
# cat /etc/wpa_supplicant.conf
# reading passphrase from stdin
network={
    ssid=$ssid
    #psk=********
    psk=********
}
# wpa_supplicant -B -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf
  1. Get IP adress by DHCP
# dhclient wlan0
# ping archlinux.org

Ethernet static address

WARNING: This section is mostly stale

NOTE: As of March, 2021, it is possible to configure static network using only ip (i.e., ip address, ip set and ip route.

  1. Add /etc/netctl/ethernet
Interface=$(interface name)
Connection=ethernet
IP=static
Address=('$(address)')
Gateway='$(gateway)'
DNS=('$(nameserver)')
  1. Enable and start netctl
# netctl enable ethernet
# netctl start ethernet

Note that the latter command will fail, if the interface is already up. In that case, use ip link set $interface down to turn off the interface and then repeat it.

For sanity check, open /etc/resolv.conf to see whether the nameserver is properly set. Otherwise, add nameserver $(nameserver address) to the file.

  1. Connect and route I am not 100% sure what's happening here, but let me just show how I was able to connect to the network and route to proper gate.
# ifconfig $interface $address/24 up
# route add default gw $gateway
# ping archlinux.org

If everything was done correctly, you should be able to connect to the internet at this point.

After installation, I prefer to install NetworkManager and use nmtui for easy network configuration.

System partition

# mkfs.ext4 /dev/sdXY
# mount /dev/sdXY /mnt
# mkswap /dev/sdXZ
# swpaon /dev/sdXZ
# # Create EFI system partition
# mkfs.fat -F32 /dev/sdXW
# mount /dev/sdXW /mnt/efi
# genfstab -U /mnt >> /mnt/etc/fstab

Pacstraip and arch-chroot

Use pacatrap to install packages and arch-chroot to switch to Arch Linux root file system. More information can be found in Arch Wiki.

Bootloader

Grub

Make sure the EFI partition is mounted at /boot/efi.

# pacman -S grub efibootmgr
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
# grub-mkconfig -o /boot/grub/grub.cfg

For me, I mount EFI partition to /boot/efi, and it worked. Nonetheless, I am not sure whether this is idiomatic, and I think this could be improved.

TBD: How to setup EFI system partition appropriately?

Language and input configuration

Locale

  1. Generate locale with locale-gen Uncomment your preferred locales from /etc/locale.gen and run locale-gen to add locales.

  2. Set locale

# localectl set-locale LANG=es_US.utf8
  1. Run ibus-daemon to enable typing Korean on URvxt
# ibus-daemon -dxr
# cat .Xdefaults
  1. Enable tap-to-click and natural scrolling with touchpad
# pacman -S libinput

TBD

Timezone

# timedatectl set-timezone Zone/City

TODO: How to sync with timeserver using different tools (e.g., ntpclient)

NVIDIA

# pacman -S nvidia
# nvidia-xconfig

Vulkan

# pacman -S vulkan-icd-loader nvidia-utils
# vulkaninfo

OpenCL/CUDA

# pacman -S ocl-icd clinfo opencl-nvidia cuda
# clinfo

Xorg

Setup minimal i3-wm environment

# pacman -S xorg-xserver xorg-xinit
# cat .xinitrc
setxbmap gb
exec i3

Enabling touchpad tap-to-click and natural scrolling

Enabling touchpad tap-to-click and natural scrolling
$ xinput list
$ xinput list-props <device>
Device '<device name>'
  libinput <property> (<id>) <val>

$ xinput --set-prop <device> <property> <val>

X resize, rotate and reflect extension (xrandr)

$ xrandr
DP-1 connedted
HDMI-1 disconnedted

# output mode
$ xrandr --output DP-1 --mode 1920x1080

# additional display
$ xrandr --output DP-1 --output HDMI-1 --left-of DP-1

Enable tapping and natural scrolling by default

$ cat /etc/X11/xorg.conf.d/90-libinput.conf
Section "InputClass"
    Identifier "libinput touchpad catchall"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
    Option "Tapping" "True"
    Option "NaturalScrolling" "True"
EndSection

Bluetooth

# pacman -S bluez bluez-utils
# systemctl start bluetooth.service
# bluetooth ctl power on

To automatically enable bluetooth on system boot:

/etc/bluetooth/main.conf

[Policy]
AutoEnable=true

Misc

  • How to mute beep sound from desktop?
# xset -b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment