Skip to content

Arch Linux ARM Operating System Installation

Prerequisites

Assumptions

  • Have a compatible memory card that can be cleared of data
  • Instructions done via the command line interface (CLI) (terminal/console)
  • Steps prefixed with a "$" (dollar sign) represents the CLI prompt. The text after the "$" is to be entered at the CLI.
  • Steps prefixed with a "#" (number sign) represents the CLI prompt with elevated user permissions (e.g. root). The text after the "#" is to be entered at the CLI.

Environment

  • Using another working Linux/Unix system with cURL installed
  • Installation is done for a Raspberry Pi device

Installation

  1. Using another Linux system, insert the SD Card.
  2. Ensure SD card is not mounted.
    $ lsblk
    
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sde      8:64   0  14.9G  0 disk
    
  3. If a path is shown under "MOUNTPOINT" for the SD Card then unmount the each applicable partition.
    # umount /dev/sdX
    
  4. Partition SD card.

    # fdisk /dev/sdX
    

    1. Type "o".

      This will clear out any partitions on the drive.

    2. Type "p" to list partitions.

      No partitions should be listed.

    3. Type "n" for new partition.

      1. Type "p" for primary.
      2. Type "1" for the first partition on the drive.
      3. Press "ENTER" to accept the default first sector.
      4. Type "+200M" for the last sector.
    4. Type "t" to set first partition type.
      1. Type "c" to set partition type to W95 FAT32 (LBA).
    5. Type "n" for new partition.
      1. Type "p" for primary.
      2. Type "2" for the second partition on the drive.
      3. Press "ENTER" twice to accept the default first and last sector.
    6. Type "p" to verify partition setup.
      Disk /dev/sde: 7.42 GiB, 7969177600 bytes, 15564800 sectors
      Disk model: USB SD Reader
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: dos
      Disk identifier: 0x5881233b
      
      Device     Boot  Start      End  Sectors  Size Id Type
      /dev/sde1         2048   411647   409600  200M  c W95 FAT32 (LBA)
      /dev/sde2       411648 15564799 15153152  7.2G 83 Linux
      
    7. Type "w" to write the partition table and exit.
  5. Format partitions.

    # mkfs.fat -F32 /dev/sdX1
    # mkfs.ext4 /dev/sdX2
    

  6. Change to home directory.
    $ cd ~
    
  7. Create temporary directories.
    $ mkdir boot root
    
  8. Mount partitions.
    # mount /dev/sdX1 boot
    # mount /dev/sdX2 root
    
  9. Download Arch Linux ARM.

    Raspberry Pi 1 & 2

    $ curl -JLO http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz
    $ curl -JLO http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz.md5
    

    Raspberry Pi 3 & 4

    $ curl -JLO http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
    $ curl -JLO http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz.md5
    

  10. Verify the download was successful.

    Raspberry Pi 1 & 2

    $ md5sum -c ArchLinuxARM-rpi-armv7-latest.tar.gz.md5
    ArchLinuxARM-rpi-latest.tar.gz: OK
    

    Raspberry Pi 3 & 4

    $ md5sum -c ArchLinuxARM-rpi-aarch64-latest.tar.gz.md5
    ArchLinuxARM-rpi-2-latest.tar.gz: OK
    

  11. Extract downloaded archive to root of the SD Card.

    Raspberru Pi 1 & 2

    # bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C root
    # sync
    

    Raspberry Pi 3 & 4

    # bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root
    # sync
    

    -x Extract to disk from archive.
    -p Perserve file permissions.
    -f Read the archive from the specified file.
    

    Note

    Depending on hardware used these commands can take sometime to complete (~10 minutes).

  12. Move boot files from root partition to boot partition.

    # mv root/boot/* boot/
    # sync
    

    Note

    Depending on hardware used these commands can take sometime to complete.

  13. Unmount SD card partitions.

    # umount boot/ root/
    

  14. Remove temporary directories.
    $ rmdir boot/ root/
    
  15. Insert the SD card into the Raspberry Pi.
  16. Connect cables to Raspberry Pi.
    1. Keyboard
    2. Video
    3. Ethernet
    4. Power supply

Post Installation

  1. Login as the root user.

    • Username: root
    • Password : root

      Note

      The default user account is alarm and password is alarm.

  2. Initialize the pacman keyring and populate the Arch Linux ARM package signing keys.

    $ pacman-key --init
    $ pacman-key --populate archlinuxarm
    

  3. Apply system updates and install the "sudo" package.
    $ pacman -Syu sudo
    
  4. Setup sudo access.
    1. Set nano as the editor.
      # export EDITOR=nano
      
    2. Create sudo group access rights.
      # visudo -f /etc/sudoers.d/sudo
      
      -f  Specify an alternate sudoers file location.
      
      %sudo ALL=(ALL) ALL
      
    3. Create the sudo group.
      # groupadd -r sudo
      
      -r  Create a system group.
      
  5. Create user account and add to group.

    # useradd -mG sudo,users <username>
    

    Note

    The sudo group is used for sudo command access (elevated privileges).

  6. Set password for new user account.

    # passwd <username>
    

  7. Logout.
    $ exit
    
  8. Login with new user account.
  9. Lock passwords for default accounts.
    # passwd -l root
    # passwd -l alarm
    
  10. Set Localization
    1. Uncomment desired locale(s).
      # nano /etc/locale.gen
      
      en_US.UTF-8
      
    2. Set locale variable.
      # nano /etc/locale.conf
      
      LANG=en_US.UTF-8
      
  11. Generate locale(s).
    # locale-gen
    
  12. Set timezone.
    # ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
    
  13. Install NTP.
    # pacman -Sy ntp
    
  14. Set time synchronization.
    # timedatectl set-ntp true
    
  15. Start and enable NTP service.
    # systemctl start ntpd.service
    # systemctl enable ntpd.service
    
  16. Set desired hostname.
    # hostnamectl set-hostname <hostname-here>