How to see which OS is running on the Raspberry Pi

My Raspberry Pi 2 Model B board boots one of many OS images from the the SD card installed using the NOOBS (New Out of Box Software) utility. While I can work with Pi without concerning the OS running, my curious mind wants to know it all the time. Here are some of the ways to find out the OS running on the Raspberry Pi board :

1. os-release
Straight off the bat, you can open the os-release file found under the /etc directory to get to know the OS and its pretty release name.

pi@deepak:~$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION="7 (wheezy)"

2. uname — System Information
David MacKenzie has written a simple yet handy utility that gives all the information regarding the OS and the hardware on which its running. I use uname all the time on all the Linux machines when I want to peek into the system.

pi@deepak:~$ uname -a
Linux deepak 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux


3. /proc/version
The proc file system (procfs) contains a boatload of information regarding processes and other system information in a hierarchical file structure. The version file inside the /proc directory gives us the uname-like information about the kernel.

pi@deepak:~$ cat /proc/version
Linux version 3.18.7-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015

4. lsb_release — Distribution-specific Information
The Linux Standard Base (LSB) is a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the filesystem hierarchy used in the Linux operating system. The LSB is based on the POSIX specification, the Single UNIX Specification (SUS), and several other open standards, but extends them in certain areas.

The command lsb_release is available in many systems to get the LSB version details. lsb_release is not available on Raspberry Pi running Raspbian. You can install it like so:

pi@deepak:~$ sudo apt-get update
pi@deepak:~$ sudo apt-get install lsb_release

After installing it, we can enjoy its usage to know all about the distribution, its release code name and much more.

pi@deepak:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.8 (wheezy)
Release:        7.8
Codename:       wheezy

About Deepak Devanand

Seeker of knowledge
This entry was posted in Raspbian and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s