How to install CentOS on a Raspberry Pi

As one of the most popular single-board computers on the market, the Raspberry Pi is the primary device in the home of most Linux users. Whether it's a home server app, a children's calculator, learning Linux or some other skill, you can definitely find a way to use a Pi.

1. Download the CentOS image

Specific Raspberry Pi images from the CentOS project are slightly hidden in the Downloads page . For the best experience, we recommend using CentOS 7. From the CentOS home page here, click on 'CentOS Linux'.

How to install CentOS on a Raspberry Pi Picture 1

Click '7 (2003)' . Such version numbers may change over time.

You will see a list of options. There are a few important things for this project: 4 options at the time of writing have 'RaspberryPi' in the name.

For this case, the example will choose the one that says 'RaspberryPi-Minimal-4' because it is installing CentOS on the Raspberry Pi 4b. Make sure to choose the one that best suits your particular use case.

How to install CentOS on a Raspberry Pi Picture 2

2. Flash the SD card

For most users, the Balena Etcher is probably the best option for flashing a Raspberry Pi SD card. One of the key points is that it will flash directly from the xzip archive you download for most Raspberry Pi images.

The flashing process is very easy. Launch the app, select the source file (in this case the CentOS archive file), the SD card port, and click Start Flashing.

How to install CentOS on a Raspberry Pi Picture 3

Balena Etcher is probably the best option for flashing a Raspberry Pi SD card

There will only be a bit more time before everything is done and you can boot from the SD card on your Pi.

3. Boot CentOS on Raspberry Pi

With these images, everything will simply turn on the device and wait until you reach the Command Prompt. If you can install the KDE or GNOME version, you will be taken straight to the login screen.

The default login information is:

  1. Username: root
  2. Password: centos

One important note:

Change the root password and create your own non-root user right away. If you don't do this, chances are someone (or a hacker) will know this and break into your system with root access. That is not good at all. The commands to create a new user are as follows:

  1. Change the root password: passwd
  2. Create a new user: useradd USERNAME -G wheel -p PASSWORD

Replace your preferred username and password. That command will create a user in the sudo or wheel group, allowing you to switch users completely and avoid logging in with root privileges. When you do that, make sure to use the su command to switch the user to the newly created user like so:

su USERNAME

Replace with the username of the user you just created. From there, make sure that the packages are updated with the command:

sudo yum update -y

4. Install a graphical desktop environment

This is one of the easiest parts. You can view the available software groups with the following command:

yum grouplist

Select the one you want to install. The example will install GNOME, but KDE Plasma is also available.

sudo yum groupinstall "GNOME Desktop"

This seems to depend on the Raspberry Pi you are using. On Pi 4b, I don't have the systemd to switch to the GUI. But this could change in your case.

4.4 ★ | 10 Vote

May be interested

  • Troubleshooting Raspberry Pi not reading SD cardPhoto of Troubleshooting Raspberry Pi not reading SD card
    many pi boards come with a microsd card and an noobs (new out of the box software) installer. of course, you can also have your own standalone image. whichever option you choose, it is recommended that you use an sd card of 8gb or higher.
  • How to turn off WiFi of Raspberry PiPhoto of How to turn off WiFi of Raspberry Pi
    there are several reasons why you might want to disable wifi on your raspberry pi. one of the reasons is to reduce system usage. although the wifi module does not consume a lot of memory and cpu, but still uses a certain amount.
  • How to set up and use ExpressVPN application for Raspberry PiPhoto of How to set up and use ExpressVPN application for Raspberry Pi
    this guide will show you the steps to set up an expressvpn application for your raspberry pi. expressvpn is compatible with raspberry pi 2 and up, using 32-bit raspbian.
  • How to run Raspberry Pi Desktop on Windows or macOSPhoto of How to run Raspberry Pi Desktop on Windows or macOS
    in this article, we will show you how to use a pc or mac to run the desktop operating system of the raspberry pi foundation, debian with the raspberry pi desktop.
  • How to watch Netflix on the Raspberry PiPhoto of How to watch Netflix on the Raspberry Pi
    for an affordable device, the raspberry pi can do a lot. one of the simplest and most useful ways is to use the pi as a low-cost alternative to a roku or fire tv.
  • How to listen to Spotify on Raspberry PiPhoto of How to listen to Spotify on Raspberry Pi
    luckily, you can make a few tweaks to get spotify working on the raspberry pi and play music via the choice of hdmi connectivity or headphone jack. here's how to listen to spotify on the raspberry pi.