Skip to content

Arch Linux ARM Operating System Installation

Prerequisites

  • Another working Linux/Unix system.
  • Installed package cURL.

Installation On Raspberry Pi ½

  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. Create temporary directories.
    # mkdir boot root
    
  7. Mount partitions.
    # mount /dev/sdX1 boot
    # mount /dev/sdX2 root
    
  8. Download Arch Linux ARM.

    Raspberry Pi 1

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

  9. Verify the download was successful.

    Raspberry Pi 1

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

    Raspberry Pi 2

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

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

    Raspberru Pi 1

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

    Raspberry Pi 2

    # bsdtar -xpf ArchLinuxARM-rpi-2-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).

  11. 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.

  12. Unmount SD card partitions.

    # umount boot/ root/
    

  13. Insert the SD card into the Raspberry Pi.
  14. 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. Install the "sudo" package.
    $ pacman -Sy 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. Install NTP
    # pacman -Sy ntp
    
  13. Start and enable NTP service.
    # systemctl start ntpd.service
    # systemctl enable ntpd.service
    
  14. Set desired hostname.
    # hostnamectl set-hostname <hostname-here>
    

Last update: September 7, 2020