Skip to content

Incorrect OS detection: Alibaba Cloud Linux 3 (OpenAnolis) misidentified as EL9, causing SELinux RPM installation failure #13418

@taihechen599

Description

@taihechen599

Hello K3s team,

I'm reporting an issue with the install.sh script incorrectly identifying Alibaba Cloud Linux 3 (OpenAnolis Edition) as el9, which leads to failed installation of the k3s-selinux package due to incompatible RPM dependencies.

🔍 Environment
OS: Alibaba Cloud Linux release 3 (OpenAnolis Edition)
Kernel: 5.10.x or newer
Architecture: x86_64
K3s version: v1.28.15+k3s1 (but affects other versions too)
Installation method: curl -sfL https://get.k3s.io | sh -
📋 /etc/os-release content:
NAME="Alibaba Cloud Linux"
VERSION="3 (OpenAnolis Edition)"
ID="alinux"
ID_LIKE="rhel fedora"
VERSION_ID="3"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (OpenAnois Edition)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"
BUG_REPORT_URL="https://help.aliyun.com/"
Note: PLATFORM_ID="platform:al8" clearly indicates RHEL 8 compatibility, not EL9.

❌ Problem
The install script’s detect_rpm_os() or setup_selinux() logic appears to infer the OS version based on kernel/glibc version or other heuristics, and mistakenly sets rpm_target=el9. As a result, it tries to download:

https://rpm.rancher.io/k3s-selinux/.../k3s-selinux-1.6-1.el9.noarch.rpm
But Alibaba Cloud Linux 3:

Is binary-compatible with RHEL 8 / CentOS 8
Ships with container-selinux-2:2.229.0-2.al8.noarch (epoch=2)
Cannot satisfy the container-selinux >= 3:2.191.0-1 requirement from EL9 packages (due to epoch mismatch)
This causes installation to fail with:

nothing provides container-selinux >= 3:2.191.0-1 needed by k3s-selinux-1.6-1.el9.noarch
✅ Workaround
We currently use:

INSTALL_K3S_SKIP_SELINUX_RPM=true
which works because the system’s built-in container-selinux is sufficient. However, this shouldn’t be necessary.

💡 Suggested Fix
In install.sh, when detecting Alibaba Cloud Linux:

If ID="alinux" and VERSION_ID="3", force rpm_target=el8
Or, more robustly, respect PLATFORM_ID: if it contains al8, treat as EL8
Example logic:

if [ "$ID" = "alinux" ] && [ "$VERSION_ID" = "3" ]; then
rpm_target="el8"
fi
🌍 Context
Alibaba Cloud Linux is widely used in China (millions of instances on Alibaba Cloud). Proper support will improve K3s adoption in this ecosystem.

Thank you for your great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions