ollama - 💡(How to fix) Fix feat: Add TencentOS Server to supported Linux distributions in install script [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14971Fetched 2026-04-08 01:03:44
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Ollama's install script does not recognize TencentOS Server when setting up the systemd service. The issue is that TencentOS's /etc/os-release has ID_LIKE="tencentos" instead of including RHEL family identifiers like "rhel centos fedora", causing the installer's Linux distribution detection to fail.

Root Cause

The install script downloads the Ollama binary successfully but fails when attempting to register the systemd service, because the OS detection logic does not recognize tencentos as a valid distribution.

Fix Action

Workaround

After the script fails, manually create the systemd service:

# The binary is already installed, just need to set up the service manually
cat > /etc/systemd/system/ollama.service << 'EOF'
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
Restart=always
RestartSec=3
Environment="HOME=/root"

[Install]
WantedBy=default.target
EOF

systemctl daemon-reload
systemctl enable --now ollama

Code Example

NAME="TencentOS Server"
  VERSION="4.4"
  ID=tencentos
  ID_LIKE="tencentos"
  VERSION_ID="4.4"
  PLATFORM_ID="platform:el9"

---

# On a fresh TencentOS Server V4.4 instance:
curl -fsSL https://ollama.com/install.sh | sh

---

# The binary is already installed, just need to set up the service manually
cat > /etc/systemd/system/ollama.service << 'EOF'
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
Restart=always
RestartSec=3
Environment="HOME=/root"

[Install]
WantedBy=default.target
EOF

systemctl daemon-reload
systemctl enable --now ollama

---

case "$ID" in
    centos|rhel|fedora|rocky|alma|tencentos)
        # RHEL-family handling
        ;;
esac

---

if [[ "$PLATFORM_ID" == platform:el* ]]; then
    # EL-compatible distribution, proceed with RHEL handling
fi
RAW_BUFFERClick to expand / collapse

Description

Ollama's install script does not recognize TencentOS Server when setting up the systemd service. The issue is that TencentOS's /etc/os-release has ID_LIKE="tencentos" instead of including RHEL family identifiers like "rhel centos fedora", causing the installer's Linux distribution detection to fail.

Environment

  • OS: TencentOS Server V4.4
  • /etc/os-release (key fields):
    NAME="TencentOS Server"
    VERSION="4.4"
    ID=tencentos
    ID_LIKE="tencentos"
    VERSION_ID="4.4"
    PLATFORM_ID="platform:el9"
  • Arch: x86_64
  • Init system: systemd
  • Package Manager: dnf

Steps to Reproduce

# On a fresh TencentOS Server V4.4 instance:
curl -fsSL https://ollama.com/install.sh | sh

The install script downloads the Ollama binary successfully but fails when attempting to register the systemd service, because the OS detection logic does not recognize tencentos as a valid distribution.

Expected Behavior

Ollama should recognize TencentOS Server as a RHEL-family distribution and complete the full installation including systemd service registration.

Actual Behavior

The systemd service setup step fails because the install script's distribution detection does not handle ID=tencentos or ID_LIKE="tencentos".

Workaround

After the script fails, manually create the systemd service:

# The binary is already installed, just need to set up the service manually
cat > /etc/systemd/system/ollama.service << 'EOF'
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
Restart=always
RestartSec=3
Environment="HOME=/root"

[Install]
WantedBy=default.target
EOF

systemctl daemon-reload
systemctl enable --now ollama

Suggested Fix

Add tencentos to the distribution detection logic in the install script:

case "$ID" in
    centos|rhel|fedora|rocky|alma|tencentos)
        # RHEL-family handling
        ;;
esac

Or use PLATFORM_ID as a more robust fallback:

if [[ "$PLATFORM_ID" == platform:el* ]]; then
    # EL-compatible distribution, proceed with RHEL handling
fi

Additional Context

  • TencentOS Server is a Linux distribution maintained by Tencent Cloud, based on the RHEL/CentOS ecosystem (EL9)
  • It serves millions of cloud instances on Tencent Cloud
  • Uses dnf package manager, supports RPM packages, runs systemd
  • Official site: https://cloud.tencent.com/product/ts
  • This issue was discovered during automated AI usability testing across Linux distributions

extent analysis

Fix Plan

To fix the issue, we need to update the install script to recognize TencentOS Server as a RHEL-family distribution. We can do this by modifying the distribution detection logic.

Step-by-Step Solution

  1. Update the case statement: Add tencentos to the list of recognized RHEL-family distributions.

case "$ID" in centos|rhel|fedora|rocky|alma|tencentos) # RHEL-family handling ;; esac

2. **Alternative solution using `PLATFORM_ID`**: Use `PLATFORM_ID` as a fallback to detect EL-compatible distributions.
   ```bash
if [[ "$PLATFORM_ID" == platform:el* ]]; then
    # EL-compatible distribution, proceed with RHEL handling
fi
  1. Apply the changes: Update the install script with the modified distribution detection logic.

Verification

To verify that the fix worked, run the install script again on a fresh TencentOS Server V4.4 instance:

curl -fsSL https://ollama.com/install.sh | sh

The script should now successfully recognize TencentOS Server as a RHEL-family distribution and complete the installation, including systemd service registration.

Extra Tips

  • Ensure that the updated install script is deployed to the production environment.
  • Test the updated script on different Linux distributions to ensure compatibility.
  • Consider adding additional logging or error handling to the install script to improve debugging and troubleshooting.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING