Install Oracle Linux on a Raspberry Pi Device

Introduction

Oracle provides an Oracle Linux (aarch64) installation image that is specifically designed to run on a variety of Raspberry Pi™ models, depending on the Oracle Linux release you are installing. Available models include the Raspberry Pi 4 Model B, Raspberry Pi 400, or Raspberry Pi 3 Model B/B+ single-board computer, Raspberry Pi Zero 2 W, and Compute Module 4. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

The installation image that is provided is a default installation of Oracle Linux (aarch64) into a raw disk image that can be cloned, block-by-block, to an SD Card for an immediate boot. Btrfs is the default file system that is used in the image. For more information about installing a Linux image onto the Raspberry Pi, visit https://www.raspberrypi.org/documentation/installation/installing-images/linux.md.

Note: The disk image for the Raspberry Pi is available as a technology preview for developer use only. As such, Oracle does not provide support for Oracle Linux on Raspberry Pi systems. Oracle recommends that developers assist each other on the Oracle Linux for Arm community forum at https://community.oracle.com/tech/apps-infra/categories/oracle-linux-for-arm.

Prerequisites

Prepare the Installation Media

  1. Obtain the Raspberry Pi disk image from the Oracle Technology Network at https://www.oracle.com/linux/downloads/linux-arm-downloads.html.

    Be sure to unzip the disk image after you download it.

  2. On an existing Oracle Linux system, insert the removable storage device to be used to copy the image file.

    For example, insert an SD Card into an SD Card reader that is connected to the system, or, for a USB attached storage device, into the USB port.

  3. Ensure that the removable storage device has enough capacity to store the image.

  4. Identify the device information for the removable storage device, for example:

    lsblk
    

    The command might generate an output resembling the following example.

    Note: The following example is an extract. Actual command output would contain more information.

    NAME
    sda
    |_sda1
    |_sda2
      |_ol-root
      |_ol-swap
      |_ol-home  
    sdb
      |_sdb1
      |_sdb2
      |_sdb3
    

    In the example, the removable storage device is sdb.

  5. Perform a block copy of the image file to the removable storage device.

    Caution: This operation is destructive and overwrites all of the data on the device you have specified. Ensure that you have specified the correct device name. Note that the operation might take some time to complete.

    sudo bash -c "xzcat compressed-image.tar.xz > /dev/path-to-device-name"
    

    In the previous command, compressed-image.tar.xz refers to the compressed image that you downloaded. Include the relative path to the image when you type the command. path-to-device-name refers to the name of of the removable storage device. Include the path to the device name when you type the command, such as /dev/sdb.

    Note that current images are optimized to fit into 4G micro SD cards instead of the previous 5G size.

  6. After the operation has completed, eject the removable device from the system.

    sudo eject /dev/sdb
    

Customize the image as appropriate

  1. Insert installation media device into the associated slot on the Raspberry Pi, then power on the device.

    The device automatically boots to Oracle Linux.

  2. Log in to the image as the root user by using the password oracle.

  3. Change the password immediately as prompted.

  4. If your removable storage device is larger than the image, you can grow the partition size to maximize disk usage.

    1. Identify the device information.

      mount | grep root
      

      Information similar to the following example might be displayed:

      dev/mmcblk1p3 on / type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/root)
      

      In the output, /dev/mmcblk1p3 indicates both the device (mmcblk1) and partition number (3).

      Note: The name of the removable storage device and the partition number are determined by the location where the removable storage device is mounted. This location can vary, depending on your Raspberry Pi model.

    2. Grow the partition size, for example:

      growpart /dev/mmcblk1 3 
      btrfs filesystem resize max /
      
  5. Set the system locale, key map and timezone by following the instructions in Learn How to Localize Your Installation on Oracle Linux.

  6. If you plan to connect to the network using a WiFi adapter rather than an Ethernet connection, then you must manually configure your network settings by using the nmcli command. For more information, see Oracle Linux 8: Setting Up Networking or Oracle Linux 9: Setting Up Networking.

  7. You can optionally also configure your installation for remote access. For more information, see Oracle Linux: Connecting to Remote Systems With OpenSSH.

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.