Raspberry Pi
This tutorial will help you install Alpine Linux on your Raspberry Pi.
Preparation
This section will help you format and partition your SD card:
- Download Alpine for Raspberry Pi tarball which is named as
alpine-rpi-<version>-armhf.rpi.tar.gz
. You will need version 3.2.0 or greater if you have a Raspberry Pi 2. - Mount your SD card to your workstation
- Use gnome-disks or fdisk to create a FAT32 partition. If you are using fdisk, the FAT32 partition type is called W95 FAT32 (LBA) and its ID is 0xC.
- Mark the newly created partition as bootable and save
- Mount the previously created partition
- Extract the tarball contents to your FAT32 partition
- Unmount the SD Card.
Installation
Alpine Linux will be installed as diskless mode, hence you need to use Alpine Local Backup (lbu) to save your modifications between reboots. Follow these steps to install Alpine Linux:
- Insert the SD Card into the Raspberry Pi and turn it on
- Login into the Alpine system as root. Leave the password empty.
- Type
setup-alpine
- Once the installation is complete, commit the changes by typing
lbu commit
Type reboot
to verify that the installation was indeed successful.
Post Installation
Update the System
Upon installation, make sure that your system is up-to-date:
apk update apk upgrade
Don't forget to save the changes:
lbu commit
During the booting time, you might notice errors related to the hardware clock. The Raspberry Pi does not have a hardware clock and therefore you need to disable the hwclock daemon and enable swclock:
rc-update add swclock boot # enable the software clock rc-update del hwclock boot # disable the hardware clock
Since Raspberry Pi does not have a clock, the Alpine Linux needs to know what the time is by using a Network Time Protocol (NTP) daemon. Make sure that you a NTP daemon installed and running. If you are not sure, then you can install NTP client by running the following command:
setup-ntp
Busybox NTP client might be the most lightweight solution. Save the changes and reboot, once the NTP software is installed and running:
lbu commit reboot
After reboot, make sure that the date
command outputs the correct date and time.