How to Find the Version of Raspberry Pi OS You Have

Jinku Hu Feb 02, 2024
  1. cat Command to Display Raspberry Pi OS Version
  2. lsb_release Command to Display Raspberry Pi OS Version
  3. dmesg Command to Display Raspberry Pi OS Kernel Information
  4. uname Command to Display Raspberry Pi OS Kernel Information
  5. lscpu Command to Display Raspberry Pi CPU Architecture
How to Find the Version of Raspberry Pi OS You Have

This article will introduce several methods to display information about which version of Raspberry Pi OS you are running.

cat Command to Display Raspberry Pi OS Version

Raspberry Pi OS versions are generally referred to using corresponding Debian release code names like: bullseye, buster, stretch, etc. However, intermittent releases of Raspberry Pi OS are numbered with dates, and archives are available on this page.

Initially, the operating system was called Raspbian, a portmanteau combining Raspberry Pi and Debian. So the above link contains separate directories for Raspbian archives, while the latest Raspberry Pi OS versions can be located in raspios_ prefixed folders.

In this case, we demonstrate how to retrieve the OS version and code name using the cat command:

cat /etc/os_release

Output:

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Even though the official name was changed on Raspberry Pi sites, the system still displays Raspbian. This article will refer to the OS using its latest name (RPI OS).

lsb_release Command to Display Raspberry Pi OS Version

lsb_release is a helpful command to display OS release, a code name, and description. lsb_release command takes -a argument to print all of these together, but it can print information separately using different arguments.

You can find its manual here.

lsb_release -a

Output:

No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

dmesg Command to Display Raspberry Pi OS Kernel Information

dmesg command without any arguments is generally used to display kernel messages from the last boot of the system. It prints much exciting information, but in this case, we will filter the kernel version-specific line using the grep command.

Suppose you’re unfamiliar with the command line. The following command utilizes the piping mechanism to redirect the output of one program to another command. grep is a pattern matching command-line tool widely available on Linux/Unix systems.

dmesg | grep "Linux version"

Output:

[    0.000000] Linux version 5.10.63-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1488 SMP Thu Nov 18 16:14:44 GMT 2021

uname Command to Display Raspberry Pi OS Kernel Information

Another useful command to display kernel version information is uname. It takes -a argument to print all available information about the system.

uname -a

Output:

Linux raspberrypi 5.10.63-v7+ #1488 SMP Thu Nov 18 16:14:44 GMT 2021 armv7l GNU/Linux

lscpu Command to Display Raspberry Pi CPU Architecture

lscpu command can be used to print the information about the CPU architecture, core count, core microarchitecture name, and some other useful information.

lscpu -a

Output:

Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1200.0000
CPU min MHz:         600.0000
BogoMIPS:            38.40
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtst
                     rm crc32
Author: Jinku Hu
Jinku Hu avatar Jinku Hu avatar

Founder of DelftStack.com. Jinku has worked in the robotics and automotive industries for over 8 years. He sharpened his coding skills when he needed to do the automatic testing, data collection from remote servers and report creation from the endurance test. He is from an electrical/electronics engineering background but has expanded his interest to embedded electronics, embedded programming and front-/back-end programming.

LinkedIn Facebook

Related Article - Raspberry Pi