Match a new release to maintenance requirements

Ubuntu's official notes identify 26.10 as released on 15 October 2026 with nine months of support, through July 2027. Those facts were reviewed on 27 October for this article. A newer version number is not by itself a reason to migrate a stable server. First identify the required maintenance horizon, hardware, installed software and the organization's available change window before turning a release announcement into an operational decision.

Interim and long-term-support releases serve different maintenance requirements. A team may need an isolated interim system to evaluate hardware or newer components while choosing a different plan for its main service. This tutorial is not an exhaustive feature catalogue and does not recommend upgrading every machine. Its practical focus is collecting the actual system state and preparing evidence that makes a later decision reviewable rather than assuming that release recency supplies all the necessary answers.

Inventory the system and review a dated policy

The example reads operating-system identification text without executing anything from that file. Distribution and version remain separate fields so that another distribution is not incorrectly classified as Ubuntu. The accompanying policy has a short review window and requires separate review for a different version. It does not assess every installed package or establish application compatibility. Use it as a small inventory and decision-recording component within a broader maintenance process.

Save the four files and run python -m unittest test_inventory.py. Tests exercise quoted values, an unrelated distribution and policy expiry using fixtures. On an Ubuntu test host, run python demo_inventory.py /etc/os-release. A Windows user can provide the path to an inventory file obtained from an authorized machine, but doing so is not the same as running Ubuntu or testing an operating-system upgrade on Windows. Keep those verification conditions explicit in any report.

The output identifies the distribution, version and policy assessment without installing or removing packages. Next, separately inventory services, package repositories, drivers and application dependencies. Exercise recovery from a usable backup and test login, networking, storage and scheduled services on the intended target in isolation. The inventory unit tests do not cover those operational acceptance conditions, which depend on the actual machine and workloads rather than the demonstration text parser.

Complete executable files

The four files are complete. The article provides prerequisites, command order and verification; code is neither shortened nor hidden.

1. Complete os_inventory.py

Save this entire file beside the others using the exact filename.

import shlex


def parse_os_release(source):
    values = {}
    for line in source.splitlines():
        if not line.strip() or line.lstrip().startswith('#'):
            continue
        key, separator, raw = line.partition('=')
        if separator and key in {'ID', 'VERSION_ID', 'PRETTY_NAME'}:
            parts = shlex.split(raw)
            if len(parts) != 1:
                raise ValueError('Unexpected os-release value')
            values[key] = parts[0]
    if values.get('ID') != 'ubuntu' or not values.get('VERSION_ID'):
        raise ValueError('Expected an Ubuntu os-release inventory')
    return values

The execution section explains this file’s command, expected outcome and limits.

2. Complete release_policy.json

Save this entire file beside the others using the exact filename.

{
  "reviewed": "2026-10-27",
  "reviewBy": "2026-11-10",
  "version": "26.10",
  "released": "2026-10-15",
  "supportUntilMonth": "2027-07",
  "releaseType": "interim",
  "source": "https://documentation.ubuntu.com/release-notes/26.10/"
}

The execution section explains this file’s command, expected outcome and limits.

3. Complete demo_inventory.py

Save this entire file beside the others using the exact filename.

from datetime import date
import json
from pathlib import Path
import sys
from os_inventory import parse_os_release


def assess(inventory, policy, today):
    if not date.fromisoformat(policy['reviewed']) <= today <= date.fromisoformat(policy['reviewBy']):
        return 'review-policy-date'
    if inventory['VERSION_ID'] != policy['version']:
        return 'review-this-release-separately'
    return 'interim-release-plan-next-maintenance-window'


if __name__ == '__main__':
    inventory = parse_os_release(Path(sys.argv[1] if len(sys.argv) > 1 else '/etc/os-release').read_text(encoding='utf-8'))
    policy = json.loads(Path(__file__).with_name('release_policy.json').read_text())
    print(json.dumps({'inventory': inventory, 'assessment': assess(inventory, policy, date.today()), 'supportUntilMonth': policy['supportUntilMonth']}))

The execution section explains this file’s command, expected outcome and limits.

4. Complete test_inventory.py

Save this entire file beside the others using the exact filename.

from datetime import date
import json
from pathlib import Path
import unittest
from os_inventory import parse_os_release
from demo_inventory import assess


class UbuntuTests(unittest.TestCase):
    def test_quoted_inventory(self):
        inventory = parse_os_release('ID=ubuntu\nVERSION_ID="26.10"\nPRETTY_NAME="Ubuntu 26.10"')
        policy = json.loads(Path(__file__).with_name('release_policy.json').read_text())
        self.assertIn('interim-release', assess(inventory, policy, date(2026, 10, 27)))
        self.assertEqual(assess(inventory, policy, date(2026, 11, 11)), 'review-policy-date')

    def test_other_distribution_is_not_guessed(self):
        with self.assertRaises(ValueError): parse_os_release('ID=debian\nVERSION_ID=13')


if __name__ == '__main__': unittest.main()

The execution section explains this file’s command, expected outcome and limits.

Run a read-only check and plan upgrade tests

Revisit the official upgrade guide and restrictions for the particular installation on the day of the decision; upgrade availability can evolve during a release cycle. Disk encryption and specialized hardware deserve particular attention before running a generic command. A controlled change needs rollback criteria, scheduling and post-change service checks. The purpose of these files is to reduce guesswork and document the decision, not to supply an automatic authorization to upgrade a production host.

Implementation checklist

  • Account for the interim support horizon.
  • Inventory the actual target machine.
  • Recheck policy and upgrade documentation.
  • Prepare recovery and rollback criteria.

References

Editorial guidance: Liyan Knowledge.