{"id":9660,"library":"distro-info","title":"Distro Info","description":"The `distro-info` library provides Python modules and data files with comprehensive information about Debian and Ubuntu distributions, including codenames, versions, release dates, and end-of-life dates. It is maintained by the Ubuntu Developers and is currently at version 1.0. Releases are stable and generally align with Debian/Ubuntu development cycles, focusing on data updates rather than frequent API changes.","status":"active","version":"1.0","language":"en","source_language":"en","source_url":"https://salsa.debian.org/python-team/packages/distro-info","tags":["system","linux","distribution","os","debian","ubuntu"],"install":[{"cmd":"pip install distro-info","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Top-level `distro_info` package does not expose specific functions directly; they are within `distro_info.ubuntu` or `distro_info.debian` submodules.","wrong":"from distro_info import get_current","symbol":"get_current","correct":"from distro_info.ubuntu import get_current"},{"note":"Functions are module-specific (e.g., for Debian or Ubuntu data).","wrong":"from distro_info import get_distro_info","symbol":"get_distro_info","correct":"from distro_info.debian import get_distro_info"}],"quickstart":{"code":"from distro_info.ubuntu import get_current, get_distro_info\n\n# Get information about the current Ubuntu development series\ncurrent_ubuntu = get_current()\nprint(f\"Current Ubuntu Series: {current_ubuntu.series} ({current_ubuntu.codename})\")\nprint(f\"Release Date: {current_ubuntu.release_date}\")\nprint(f\"Support until: {current_ubuntu.eol_date}\")\n\n# Get information for a specific Debian codename\ndebian_stretch = get_distro_info(codename='stretch')\nif debian_stretch:\n    print(f\"\\nDebian Stretch Version: {debian_stretch.version}\")\n    print(f\"Debian Stretch Codename: {debian_stretch.codename}\")\nelse:\n    print(\"\\nCould not find Debian 'stretch' information.\")\n","lang":"python","description":"This quickstart demonstrates how to fetch information about the current Ubuntu development series and a specific Debian distribution using their respective submodules."},"warnings":[{"fix":"Ensure your environment is running Python 3.6 or newer. Upgrade your Python interpreter if necessary.","message":"Python 2 support was dropped in `distro-info` version 1.0. Attempting to use this version with a Python 2 interpreter will result in SyntaxErrors or similar compatibility issues.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Understand the library's scope: it's a data provider for Debian/Ubuntu distribution information, not a general-purpose host OS detection utility. For host OS detection, consider libraries like `distro` (without the -info suffix).","message":"This library provides hardcoded data about Debian and Ubuntu distributions. It does NOT detect the host operating system you are running on. If you use it on a Fedora, CentOS, macOS, or any non-Debian/Ubuntu system, it will still return data specific to Debian/Ubuntu, not your actual OS.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always import functions from their specific submodule, e.g., `from distro_info.ubuntu import get_current`.","message":"The main functions like `get_current()` and `get_distro_info()` are located within specific submodules (`distro_info.ubuntu` or `distro_info.debian`), not directly available from the top-level `distro_info` package.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Functions like `get_current` are located in submodules. Import them correctly: `from distro_info.ubuntu import get_current` or `from distro_info.debian import get_distro_info`.","cause":"Attempting to import functions directly from the top-level `distro_info` package instead of its specific submodules.","error":"ImportError: cannot import name 'get_current' from 'distro_info'"},{"fix":"This library is designed for querying Debian and Ubuntu distribution details. If you need to detect the operating system your Python code is running on, use a different library like the `distro` package (note: no `-info` suffix) or standard library modules like `platform`.","cause":"Misunderstanding the library's purpose. `distro-info` provides static data *about* Debian/Ubuntu distros, not dynamic detection of the host OS.","error":"My code shows 'Ubuntu Focal Fossa' but I'm on Fedora!"},{"fix":"Ensure your Python environment is using Python 3 (specifically, Python 3.6+ is recommended for `distro-info` 1.0+). Upgrade your interpreter if needed.","cause":"Running `distro-info` (especially version 1.0 or newer) with a Python 2 interpreter. Version 1.0 dropped Python 2 support.","error":"SyntaxError: Missing parentheses in call to 'print'"}]}