Skip to content

Arch Linux Installation ARM

Lean's edited this page Jan 6, 2026 · 37 revisions

Raspberry PI 4

This example is using sd card, feel free to change mmcblk to whatever partition you are using

  • wget "http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
  • cfdisk /dev/mmcblk1
  • Creates one partition 512MB as FAT32

  • Creates another with ext4 (Linux Partition)

  • mkfs.vfat /dev/mmcblk1p1
  • mkfs.ext4 /dev/mmcblk1p2
  • mkdir /mnt
  • mount /dev/mmcblk1p2 /mnt
  • mkdir /mnt/boot
  • mount /dev/mmcblk1p1 /mnt/boot
  • bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C /mnt
  • genfstab -U /mnt >> /mnt/etc/fstab
  • If you want to add some packages or change configurations before booting you can use arch-chroot /mnt

  • Pacman Init
# Execute this inside the sd card (chroot)
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Sy
  • umount /mnt/boot
  • umount /mnt
  • Now add the sd card into device and start it

Utils

  • Change hostname: hostnamectl set-hostname my-device-beautiful-name
  • Use rapsberry-pi commands: sudo pacman -S raspberrypi-utils

Weekly update

  • vim /usr/local/bin/update_and_reboot.sh
  • Put everthing from update_and_reboot.sh inside it
  • vim /etc/systemd/system/update_and_reboot.service
[Unit]
Description=Update Arch Linux and Reboot

[Service]
Type=oneshot
ExecStart=/usr/local/bin/update_and_reboot.sh
  • vim /etc/systemd/system/update_and_reboot.timer
[Unit]
Description=Timer for weekly Arch Linux update and reboot

[Timer]
OnCalendar=Tue 20:00:00
Persistent=true

[Install]
WantedBy=timers.target
  • sudo systemctl enable --now update_and_reboot.timer
  • Now you device will update on Tuesday 8 pm

Corrupted Files

If you have a bad micro sd card, some files can be corrupted sometimes, especially if you turned off the device while a file still writing or due to power outages.

  • use a recovery boot pen-drive (or just insert the sd card in your home device)
  • do not mount it
  • execute this command to check remove and clean corrupted files: fsck.ext4 -f /dev/sde2
  • Accept everything, and pray for important files to not be deleted (probably was just tmp files or logs)

  • now you can insert it again on your raspberry pi and test if everthing is working again

Clone this wiki locally