DEV Community

alexif57
alexif57

Posted on

How to Quickly Check Your Ubuntu Version

The "Ubuntu Version Checker" is a Bash script designed to quickly and reliably determine the version of the Ubuntu operating system installed on a Linux system.

This script is particularly useful for system administrators, developers, and users who need to identify the precise Ubuntu release running on their system.

Usage:

  1. Download the check_ubuntu_version.sh scriot from here:
    https://sourceforge.net/projects/check-ubuntu-version/

  2. Make the script executable by running:

chmod +x ./check_ubuntu_version.sh

Enter fullscreen mode Exit fullscreen mode
  1. Launch it with:
./check_ubuntu_version.sh

Enter fullscreen mode Exit fullscreen mode

The script will promptly display the Ubuntu OS name, version/release, and codename, making it easy to identify the specific Ubuntu distribution installed.

Ubuntu Version Checking script

Key Features:

- Robust Detection:

The script first checks for the presence of the lsb_release command, a standard utility for obtaining distribution information. If lsb_release is available, it uses this tool to extract the Ubuntu version and codename. If not, it falls back to an alternative method.

- Detailed Output:

The script provides a comprehensive and informative output. It not only displays the OS name, version/release, and codename but also separates each piece of information for clarity.

- Fallback Method:

In the absence of lsb_release, the script reads information from the /etc/os-release file, a widely supported method for retrieving OS details on Linux systems. This ensures compatibility across various Linux distributions.

Use Cases:

- System Identification:

System administrators can use this script to quickly identify the Ubuntu version on multiple servers, aiding in maintenance and troubleshooting tasks.

- Compatibility Checking:

Developers and software maintainers can use this script to verify the Ubuntu version on which their software is running to ensure compatibility.

- User Information:

Regular Ubuntu users can run this script to learn more about their system and its release details.

Conclusion:

In summary, the "Ubuntu Version Checker" script simplifies the process of determining the Ubuntu version and provides detailed information in a structured format, improving system management and user awareness.

Top comments (0)

The discussion has been locked. New comments can't be added.