Black Friday Deals Not Found Anywhere Else! Save up to 55% OFF Hosting, Domains, Pro Services, and more.
Vodien Black Friday Sale applies to new purchase on select products and plans until 4 December 2024. Cannot be used in conjunction with other discounts, offers, or promotions.
How to Check Your Ubuntu Version A Step-by-Step Guide

How to Check Your Ubuntu Version: A Step-by-Step Guide

Checking your Ubuntu version is essential for software compatibility, security updates, and troubleshooting. You can easily verify your version via the terminal using commands like `hostnamectl` or `/etc/os-release` or through the GUI in Settings. Proactive management, such as automating updates and monitoring EOL dates, ensures system reliability and security.

Knowing your Ubuntu version is crucial for installing compatible software, applying security patches, and troubleshooting issues. Whether you’re managing servers for an SME or developing applications, this guide provides foolproof methods to perform an Ubuntu version check, ensuring your system stays up-to-date and secure.

For businesses hosting mission-critical workloads on platforms such as Vodienhosting transferhaving current systems is not an option but a necessity for reliability and compliance.

Why Check Your Ubuntu Version?

Ubuntu’s six-month release cycle and LTS (Long-Term Support) updates mean version nuances impact everything from kernel compatibility to Python runtime environments. A mismatch can break CI/CD pipelines or leave DevOps teams debugging phantom issues. Knowing your version isn’t just maintenance—it’s preemptive problem-solving:

  • Software Compatibility: Packages and dependencies vary between releases (e.g., 20.04 vs. 22.04)
  • Security Updates: Older versions (like 18.04) reach end-of-life, leaving systems vulnerable
  • Documentation Accuracy: Solutions often differ across versions
Also Read: Linux vs Windows Hosting

Method 1: Ubuntu Version Check via Terminal

Terminal commands are the sysadmin’s Swiss Army knife—fast, scriptable, and reliable in headless environments. Unlike GUIs, they bypass potential desktop crashes, making them indispensable for remote servers powering e-commerce sites or SaaS platforms.

a. Using hostnamectl

This command displays the OS version alongside host details:

bash

hostnamectl

Relevant Output:

Operating System: Ubuntu 22.04.3 LTS

Kernel: Linux 5.15.0-78-generic

b. Checking /etc/os-release

View the OS release file directly:

bash

cat /etc/os-release

Key Lines:

VERSION=22.04.3 LTS (Jammy Jellyfish)

VERSION_ID=22.04

Method 2: GUI-Based Ubuntu Version Check

For teams transitioning from Windows or macOS, the GUI method bridges familiarity with functionality. It’s ideal for non-technical auditors needing quick verification or environments where CLI access is restricted for security compliance.

a. Settings Application

  1. Open Settings (gear icon in the dock)
  2. Navigate to About > OS Name
  3. View details like version, codename, and architecture

b. System Monitor

  1. Launch System Monitor from the applications menu
  2. Check the System tab for OS information

Troubleshooting Common Issues

A missing lsb_release isn’t just an error—it’s a red flag for incomplete installations or deprecated packages. These hiccups often reveal deeper issues like broken dependencies or misconfigured repositories that could cascade into security gaps.

Even with straightforward commands, Ubuntu version checks can hit snags. Here’s how to diagnose and resolve frequent pitfalls:

a. ‘Command Not Found’ Errors

  • Example: lsb_release: command not found
  • Root Cause: The lsb-release package, which provides Linux Standard Base (LSB) details, is missing. This often occurs in minimal Ubuntu installations (e.g., Docker containers) to reduce bloat.
  • Fix: Install the package:
  • bash
  • sudo apt update && sudo apt install lsb-release -y
  • Prevention: Include lsb-release in base images for DevOps pipelines to avoid CI/CD failures

b. Outdated Version Information

  • Example: A server upgraded from 20.04 to 22.04 still reports the old version
  • Root Cause: Cached package lists or incomplete upgrades
  • Fix: Refresh repositories and upgrade packages:

bash

sudo apt update && sudo apt upgrade -y

  • Verify: Reboot and recheck with hostnamectl

c. Corrupted Release Files

  • Example: /etc/os-release contains garbled text
  • Root Cause: Disk errors or improper shutdowns during updates
  • Fix:

1. Run a filesystem check:

bash

sudo fsck /dev/sda1  # Replace with your disk partition

2. Reinstall the base-files package:

bash

sudo apt install –reinstall base-files

d. Permission Denied Errors

  • Example: Permission denied when accessing /etc/os-release.
  • Root Cause: Incorrect file permissions or SELinux/AppArmor restrictions.
  • Fix:

bash

sudo chmod 644 /etc/os-release  # Reset permissions

For enforced security modules:

bash

sudo aa-complain /etc/os-release  # AppArmor

sudo restorecon -v /etc/os-release  # SELinux

Best Practices for Ubuntu Systems

Version checks are the first step in a lifecycle that demands proactive governance. Pair them with automated patch management and kernel audits to preempt zero-day exploits—critical for industries like finance or healthcare, where downtime costs millions per hour.

Proactive management of Ubuntu systems ensures security, performance, and compliance—especially for businesses handling sensitive data.

a. Monitor End-of-Life (EOL) Dates

Why: Unsupported versions (e.g., Ubuntu 18.04 post-2023) receive no security patches

Action:

  • Check EOL schedules on Ubuntu’s official site
  • Set calendar alerts for EOL deadlines and plan upgrades 6 months in advance

b. Automate Updates

  • Why: Manual updates risk human error and delays
  • Tools:

Unattended Upgrades: Configure automatic security patches:

bash

sudo apt install unattended-upgrades

  • sudo dpkg-reconfigure unattended-upgrades
  • Ansible/Puppet: Use playbooks to enforce version consistency across server fleets

c. Maintain Version Documentation

Why: Auditors and DevOps teams need accurate system records

Action:

  • Log versions in a centralised dashboard (e.g., Grafana)
  • Tag servers in cloud platforms (AWS, Azure) with metadata like Ubuntu-22.04-LTS

d. Use Official Repositories

Why: Third-party PPAs can introduce compatibility issues

Action:

  • Prioritise packages from main and universe repositories
  • Verify GPG keys for external repos to prevent supply-chain attacks

e. Schedule Kernel Audits

Why: Kernel vulnerabilities (e.g., Dirty Pipe) often require immediate patching

Action:

  • Check the kernel version with uname -r
  • Subscribe to Ubuntu Security Notices (USNs) for alerts

f. Configure Backups Before Major Upgrades

Why: Failed upgrades can brick systems

Timeshift: Snapshot the OS before upgrading:

sudo timeshift –create –comments “Pre-22.04 upgrade”

Cloud Backups: Use automated tools like rsync or vendor-specific solutions

Conclusion

Performing an Ubuntu version check takes seconds but safeguards your system’s security and functionality. Whether via terminal or GUI, these methods ensure you’re always informed.

Streamline your Ubuntu management with Vodien’s hosting solutions. We offer robust VPS hosting with dedicated resources, advanced security measures like free SSL certificates, and 24/7 expert support to address technical challenges promptly.

Our solutions are designed to enhance reliability, reduce downtime, and provide flexibility for growing businesses while integrating digital marketing tools to boost online visibility. 

To learn more, talk to us now!