How to Check the Linux OS Version in 5 Easy Ways: The Ultimate Guide

Written by

Reviewed by

Last updated: July 24, 2024

Expert verified

SVG Image

TL;DR

Here are different easy ways to check the Linux OS version:

  1. To check the Linux OS version using lsb_release, type lsb_release -a in the terminal for detailed distribution information.
  2. To see kernel and system architecture details, use the uname -a command in the terminal.
  3. Access the /etc/os-release file by typing cat /etc/os-release in the terminal to view the distribution name, version, and ID.

Learn more about how to check the Linux OS version on your system using CLI and GUI methods. Also, discover the top three tools, the easy Linux OS upgrading process, and its five best practices to follow.

Knowing your OS version is crucial for security, compatibility, and support. In this post, I’ll show you how to find your Linux OS version using various methods, from command-line tools like lsb_release and hostnamectl to GUI options and third-party tools like Neofetch. I’ll also guide you on how to upgrade your OS and share best practices to ensure a smooth experience. By the end, you’ll have all the knowledge you need to keep your system updated and secure.

What is an OS Version?

An OS version tells you which specific release of the operating system (OS) you are using. Think of it like the edition of a book, each version might have new features, improvements, or fixes compared to earlier ones. In Linux, the OS version includes details about the specific distribution and the release number, like Ubuntu 20.04 or CentOS 8.

Importance of OS Versioning in Linux

Knowing your OS version is crucial for several reasons:

  • Security: Newer versions often come with important security updates that protect your system from vulnerabilities.
  • Compatibility: Some software works only with specific OS versions, so knowing your version helps you avoid compatibility issues.
  • Support: When you seek help online or from support services, they usually need to know your OS version to give accurate advice.
  • Performance: Updates in new OS versions can include performance improvements that make your system run faster and more efficiently.

How to Check the Linux OS Version [4 Easy Ways]

To check the Linux OS version, you can use several methods. Run the lsb_release -a command in the terminal for detailed info, or use uname -a for kernel and system architecture details. Access the /etc/os-release file by typing cat /etc/os-release. You can also use the hostnamectl command. For a graphical approach, navigate to the settings and look for system information.

Here are the detailed steps to use these methods on your Linux system:

1. Use lsb_release Command

The lsb_release command is a standard tool for checking Linux distributions. It provides detailed information about your Linux OS. To know the Linux OS version with this command, follow these steps:

  1. Launch the Terminal or command-line interface on your Linux system.
command line interface on your linux system
  1. Type the command below and press Enter.
lsb_release -a

The output will display information about your Linux distribution, including the release number and codename.

information about your linux distribution linux os version

2. Use uname Command

The uname command provides information about the operating system, including the kernel version and system architecture. To see the Linux OS version details using this command, follow these steps:

  1. In the command prompt, execute the following command:
uname -a

The output will show details such as the kernel version, system architecture, and other relevant information.

show details linux os version

3. Access /etc/os-release File

The /etc/os-release file contains information about the operating system, including the distribution name, version, and ID. To check the Linux OS version by accessing this file, follow these steps:

  1. Type the command below in the Terminal window and press Enter.
cat /etc/os-release

The output will provide details about your Linux OS, including the distribution name, version, and ID.

details about your linux os

4. hostnamectl Command

The hostnamectl command in Linux is a straightforward and powerful tool that provides various details about your system, including the OS version. This method is perfect for users who prefer using the command line. Follow these steps.

  1. In the terminal, type the following command and press Enter:
hostnamectl

Look at the output for the line starting with Operating System. This line shows your OS name and version.

run this command to view os name and version

5. Use GUI Method

In addition to the command-line methods, you can check the Linux OS version using graphical user interface (GUI) methods provided by your desktop environment.

  1. Navigate to the Application menu.
navigate to the application menu
  1. Look for an icon like Settings and click on it.
look for an icon like settings
  1. Scroll down the listed items in the left pane, and click About.
scroll down the listed items in the left pane
  1. Now, the right pane should display your Linux OS version, distribution name, and other relevant details.
display your linux os version distribution name

Top 3 Third-Party Tools to Check the Linux OS Version

Apart from these built-in methods, there are third-party tools available that provide more detailed system information about the Linux OS version. Here are three of the most commonly used tools among Linux users:

1. Neofetch

Neofetch is a popular third-party tool that displays detailed system information in a visually appealing way. It shows various system details, including the Linux distribution, kernel version, CPU, GPU, and memory. To install and use Neofetch:

  1. First, update the package repository by running the command:
sudo apt update
  1. Install Neofetch using the package manager with the command:
sudo apt install neofetch
  1. Enter y if prompted to continue with the installation.
enter y if prompted
  1. Wait for a few minutes for the installation to complete.
wait for a few minutes for the installation to complete
  1. Once the installation is complete, you can run Neofetch to display system information by simply typing:
neofetch
  1. You’ll see the details of the Linux OS version in the Terminal window once you execute the command:
details of the linux os version in the terminal window

2. Screenfetch

Screenfetch is another third-party tool that fetches system information and displays it in the terminal. It provides a simple and compact overview of your Linux OS. To install and use Screenfetch:

  1. Head to the Linux command-line interface and update the package repository by running the command:
sudo apt update
  1. Install Screenfetch using the package manager with the command:
sudo apt install screenfetch
  1. Type y and press Enter to carry on with the installation process.
type y and press enter to carry on
  1. Once the installation is complete, you can run Screenfetch to view system information by typing:
screenfetch
  1. You’ll now see the following details of the Linux OS version installed on your system.
details of the linux os version installed on your system

3. Inxi

Inxi is a versatile and comprehensive command-line tool that provides extensive system information, including hardware details, software versions, and more. It is particularly useful for diagnosing and troubleshooting Linux systems. To install and use Inxi:

  1. Launch the Terminal app and update the package repository by running the command:
sudo apt update
  1. Install Inxi using the package manager with the command:
sudo apt install inxi
  1. To continue the installation process, simply enter y and press Enter.
simply enter y and press enter
  1. Once the installation is complete, you can generate detailed system information by running the command:
inxi
  1. The system will now display detailed information about the installed Linux OS version.
about the installed linux os version

How to Upgrade the Linux OS in 2 Easy Ways

If you have an outdated version of Linux installed on your system, you should upgrade to the latest version to take advantage of new features and experience enhanced security improvements. Here’s how you can use them to upgrade your Linux OS:

1. Command line Upgrade Process

You can upgrade your Linux operating system effectively using the command line. This approach provides a direct and precise method to manage software updates, allowing for more advanced options and deeper control over the upgrade process. Here are the steps to upgrade your Linux OS using the command line:

  1. Launch the Terminal and update the package repository by running the command:
sudo apt update
  1. Next, upgrade the installed packages to their latest versions using the command:
sudo apt upgrade
  1. Continue with the installation by typing y and pressing Enter.
continue with the installation
  1. Wait for the upgrade process to complete.
wait for the upgrade process to complete
  1. After the upgrade of packages, you may need to update your package manager’s distribution upgrade tool. Use the command:
sudo apt dist-upgrade
  1. Once the distribution upgrade tool is updated, initiate the distribution upgrade process by running the command:
sudo do-release-upgrade
  1. After the upgrade is finished, it is recommended to reboot your system to apply the changes. You can do this by running the command:
sudo reboot

2. GUI-based Upgrade process

The GUI provides a more visually intuitive way to manage software updates and ensures a smoother and more accessible upgrade process. Follow the steps below to upgrade your Linux OS using a graphical user interface (GUI):

  1. Head to the Application menu.
head to the application menu
  1. Look for Software Updater.
look for software updater
  1. Launch the application and check for available updates.
check for available updates
  1. If a new version of your Linux distribution is available, you should see an option to upgrade. And you’ll have to follow the on-screen instructions to proceed with the upgrade. Once the upgrades are installed, reboot your system to ensure all changes take effect. However, you’ll see the following notification if your Linux OS version is already up-to-date.
linux os version is already up to date

    5 Best Practices When Upgrading the Linux OS

    When upgrading the Linux operating system (OS), it’s crucial to follow these five best practices to ensure a smooth and successful upgrade process::

    • 📂 Backup your data: Before performing any major system upgrade, it’s essential to back up your important files and data to prevent data loss in case of any issues during the upgrade process. Use tar to create a backup: tar czvf backup.tar.gz /path/to/your/data.
    • 📜 Read release notes: Take the time to read the release notes or documentation for the new version of your Linux distribution. It provides valuable information about new features, known issues, and specific instructions for the upgrade process.
    • 💻 Check hardware compatibility: Ensure that your hardware is compatible with the new version of the Linux distribution. Some hardware drivers or components may require additional steps or adjustments after the upgrade. Use the command lspci to check the hardware information.
    • Be patient: Upgrading your Linux OS can be a time-consuming process, especially if it involves downloading a significant amount of data. Be patient and allow the system ample time to complete the upgrade.
    • 👀 Monitor the upgrade process: Pay attention to any error messages or prompts during the upgrade process. Provide the necessary responses or take corrective actions as needed. Use the command sudo apt-get upgrade to resolve package-related errors during the upgrade.

    To Sum Up

    Throughout this article, I’ve explored several ways to check your Linux OS version, including commands like lsb_release, uname, and hostnamectl, as well as GUI methods. I have also discussed third-party tools like Neofetch, Screenfetch, and Inxi for detailed system information. Plus, I showed you how to upgrade your Linux OS using command line and GUI methods, along with best practices to ensure smooth upgrades.

    To expand your Linux knowledge, you might want to read about:

    Frequently Asked Questions

    How often should I check my Linux OS version?

    It’s a good practice to check your Linux OS version periodically or whenever you suspect there might be updates available. This ensures that you stay informed about the latest features, security patches, and compatibility improvements.

    Can I check my Linux OS version remotely?

    Yes, you can check your Linux OS version remotely using SSH (Secure Shell) or other remote access methods. Simply connect to your Linux system using an SSH client and execute the appropriate commands mentioned earlier in this guide.

    How do I check the available disk space in Linux?

    To check the available disk space in Linux, use the df -h command in the Terminal. This will provide a summary of disk usage for all mounted file systems, including the available space. Monitoring disk space helps ensure efficient storage management on your Linux system.

    Is it possible to downgrade my Linux OS?

    Downgrading your Linux OS is generally not recommended or supported. The upgrade process is designed to move forward, ensuring system stability, security, and compatibility with newer software and hardware. Reverting to an older version can introduce compatibility issues and security vulnerabilities. It is advisable to perform a fresh installation of the desired older version if needed, but proper backup and data migration is essential.

    Why should I keep my Linux OS up-to-date?

    You should keep your Linux OS up to date due to following three main reasons:
    – Enhanced security: Updates fortify against vulnerabilities, safeguarding data, privacy, and stability.
    – Boosted performance: Optimizations, such as improved drivers and resource management, enhance responsiveness and overall performance.
    – New features and compatibility: Staying current grants access to the latest features, ensuring seamless compatibility with innovative software and technologies.

    Ojash

    Author

    Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

    Akshat

    Reviewer

    Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

    Share this article
    Shareable URL
    Prev Post

    [6 Proven Fixes] “zipimport.zipimporterror: can’t decompress data; zlib not available”

    Next Post

    How to Clear the Terminal Screen in Linux [4 Quick Ways]

    Read next