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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay