It is essential to know the currently installed operating system, its version, and also the Linux kernel version on your machine to install the correct packages and apply the appropriate security patches. Not just that, being a system administrator, knowing the system details also comes in handy for troubleshooting issues.
In this guide, we are going to walk you through various methods to determine your Linux version.
Checking the OS and Linux version
We have two main ways:
- Via a graphical user interface
- Via the command line way (recommended)
Let’s get started.
Method 1: Graphical User Interface Way
Typically, using a graphical user interface to perform any task is considered the most comfortable way, but you get limited information. Most of the Linux distros have an About or System Information app that should give you necessary OS details. In the below example, we fetch details from the Ubuntu system.
Step 1. From Ubuntu’s top panel, click on the Dropdown arrow.
Step 2. Click the Settings button to open the settings application.
Step 3. From the left panel, scroll down and open the Details menu.
Step 4. From the left panel, select the About option.
Step 5. You should now see the details of your system. As you see in the below screenshot, I could see RAM size, Processor type, Graphics info, Desktop Environment version (GNOME in my case), OS architecture, and disk size.
Method 2: Command Line Way
This method is the most favorite method among Linux users because sometimes you may be working on a machine that has no graphical user interface installed, such as Ubuntu Server. Note that several commands can be used. We discuss the best commands to use.
lsb command
Launch the Terminal. On Ubuntu machines, this can be done by pressing Ctrl+Alt+T simultaneously. Enter the following command in the Terminal and press enter.
lsb_release -a
The command will print some details about the currently installed Linux distro. However, if you need to get the current version, only use the -d option with the lsb_release command:
lsb_release -d
hostnamectl Command
Another command you can use to preview some information about your system is the command used to get the machine hostname.
hostnamectl
As you can notice, the hostnamectl command will preview some additional information about your system, including the Linux distro version and Linux Kernel version too.
/etc/issue File
Another way is to open a file in the path /etc/issue file that holes the OS information:
cat /etc/issue
/etc/os-release File
There is yet another file in the path /etc/os-release that holds some info about the currently installed operating system.
cat /etc/os-release
/etc/os-release File
Finally, you can also use the lsb-release File to view the current system version.
cat /etc/lsb-release
Conclusion
Those are all the ways you can use to fetch the OS version and Linux version details from your system. I hope the tutorial helped you in learning one or two things about the Linux command-line usage. Feel free to pick the one you feel comfortable with. That’s it for now.