Skip to content

Instantly share code, notes, and snippets.

@rsp9u
Created December 14, 2019 04:21
Show Gist options
  • Save rsp9u/a17edc7f6f9c2b9af25e3696071bc41a to your computer and use it in GitHub Desktop.
Save rsp9u/a17edc7f6f9c2b9af25e3696071bc41a to your computer and use it in GitHub Desktop.
Installation guide of Archlinux into Raspberry Pi 2
  1. Write to a SD card on the existing linux machine
    # pacman -Syu dosfstools
    # cfdisk /dev/sdb
    # mkfs.vfat /dev/sdb1
    # mkfs.ext4 /dev/sdb2
    # mount /dev/sdb2 /mnt
    # mkdir /mnt/boot
    # mount /dev/sdb1 /mnt/boot
    # wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz  #see https://archlinuxarm.org/about/downloads
    # bsdtar -xpf /home/rsp9u/ArchLinuxARM-rpi-2-latest.tar.gz -C /mnt
    # umount /mnt/boot
    # umount /mnt
    
  2. Insert the SD card to Pi, connect an ehternet cable, and turn on Pi.
  3. Update keyring
    # pacman-key --refresh-keys
    # pacman -S archlinux-keyring
    # pacman-key --init
    # pacman-key --populate archlinuxarm
    
  4. Upgrade all the installed packages
    # pacman -Syu
    
  5. Enable Wi-Fi
    # pacman -Syu wpa_supplicant
    # cat << EOS > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
    ctrl_interface=DIR=/run/wpa_supplicant
    update_config=1
    
    network={
      ssid="SSID"
      psk=...
      ...
    }
    EOS
    # systemctl start wpa_supplicant@wlan0.service
    # systemctl enable wpa_supplicant@wlan0.service
    # cat << EOS > /etc/systemd/network/wlan0.network
    [Match]
    Name=wlan0
    
    [Network]
    DHCP=ipv4
    EOS
    # shutdown -r now
    
  6. Add user, Change ssh settings, and so on..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment