Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse os-release to identify OS by ID_LIKE field (i.e. make install-dependencies.sh work on Amazon Linux 2023) #3155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Feb 16, 2024

  1. Parse os-release to identify OS by ID_LIKE field

    The /etc/os-release file has evolved over the years, with current
    documentation being at
    https://www.freedesktop.org/software/systemd/man/latest/os-release.html
    
    Part of this spec is to also look at /usr/lib/os-release as image based
    Linux distributions that can exist without anything in /etc may put the
    os-release file there.
    
    In the docs, Example 3 shows how to parse this file with shell. We can
    use that example and look at ID_LIKE to better determine if the OS is a
    Debian like system, or a Fedora like system, and differentiate between
    how RHEL / CentOS and friends are like Fedora and how non-RHEL,
    non-CentOS is also like Fedora.
    
    The practical end-outcome of this is that it will now correctly detect
    Amazon Linux 2023, pick 'dnf' as the package manager, and install the
    dependencies.
    
    Fixes: actions#2511
    Signed-off-by: Stewart Smith <trawets@amazon.com>
    stewartsmith committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    d943b51 View commit details
    Browse the repository at this point in the history