# alinux-software

Part of **ALINUX**

# Alibaba Cloud Linux Software and Kernel Management Troubleshooting Guide

## Problem Index

| Problem | Symptom | Severity | Solution Summary |
|--------|--------|---------|------------------|
| Ansible Installation Fails Due to EPEL Repository Conflict | Error: `Problem: conflicting requests - nothing provides python(abi) = 3.12` | High | Switch from `epel` to `epel-archive` repository and reinstall |
| Kernel Hotpatch Causes System Instability with OverlayFS | Unexpected system crashes or hangs when using containers or layered filesystems | High | Apply recommended kernel hotpatch or disable problematic features |
| Package Manager Reports Broken Dependencies | `Error: Unable to find a match` or `skip-broken` suggested | Medium | Clean metadata cache and retry with correct repository configuration |

## Problem Details

### Problem 1: Ansible Installation Fails Due to EPEL Repository Conflict

**Symptoms**
- Error message: `Problem: conflicting requests - nothing provides python(abi) = 3.12`
- Behavior: `yum install ansible` or `dnf install ansible` fails with dependency resolution errors
- Context: Occurs on Alibaba Cloud Linux 3 when the standard EPEL repository is enabled

**Root Cause**
The default EPEL repository contains packages built for older Python versions and is incompatible with Alibaba Cloud Linux 3’s Python 3.12 runtime. The `ansible` package in EPEL requires `python3.12dist(ansible-core)`, which is not satisfied by the current repository setup.

**Solution**
1. Replace all instances of `epel` with `epel-archive` in YUM/DNF repository files:
   ```bash
   sudo sed -i 's/epel/epel-archive/g' /etc/yum.repos.d/*.repo
   ```
2. Clear the YUM/DNF metadata cache:
   ```bash
   sudo yum clean all
   ```
3. Install Ansible:
   ```bash
   sudo yum install -y ansible
   ```

**Verification**
- Run `ansible --version` to confirm successful installation
- Expected output includes version number and Python interpreter path without errors

### Problem 2: Kernel Hotpatch Causes System Instability with OverlayFS

**Symptoms**
- Behavior: ECS instance becomes unresponsive or crashes during container operations
- Context: Occurs after applying certain kernel hotpatches when OverlayFS is in use (common in Docker or Kubernetes environments)
- Diagnostic clue: System logs may indicate dentry leaks or memory pressure related to filesystem layers

**Root Cause**
Some kernel hotpatches interact poorly with OverlayFS, leading to resource leaks (e.g., dentry structures not being freed), which can eventually cause system instability or out-of-memory conditions.

**Solution**
1. Check if your instance is affected by reviewing kernel version and hotpatch status:
   ```bash
   uname -r
   cat /proc/virtualization
   ```
2. If using a known problematic hotpatch, either:
   - Upgrade to a newer Alibaba Cloud Linux kernel that includes a fixed hotpatch, or
   - Temporarily avoid workloads that heavily use OverlayFS until a stable update is available
3. Monitor system stability using:
   ```bash
   dmesg -T | grep -i "overlay\|dentry"
   ```

**Verification**
- System remains stable under containerized workload stress
- No recurring `dentry` leak messages in `dmesg` or `/var/log/messages`

### Problem 3: Package Manager Reports Broken Dependencies

**Symptoms**
- Error message: `Error: Unable to find a match` or suggestion to use `--skip-broken`
- Behavior: Software installation fails even for basic packages
- Context: After repository misconfiguration or partial update

**Root Cause**
Repository metadata is stale or inconsistent, often due to mixing incompatible repositories (e.g., EPEL with base OS repos) or interrupted updates.

**Solution**
1. Clean all cached metadata:
   ```bash
   sudo yum clean all
   ```
2. Rebuild the cache:
   ```bash
   sudo yum makecache
   ```
3. Retry the installation. If issues persist, verify repository files in `/etc/yum.repos.d/` do not reference outdated or conflicting sources.

**Verification**
- `yum list available | head` returns package list without errors
- Target package installs successfully

## FAQ

**Q: How do I check which repositories are currently enabled on Alibaba Cloud Linux 3?**  
A: Run `yum repolist enabled` or `dnf repolist enabled` to list all active repositories and their status.

**Q: What should I do if `yum install` suggests using `--skip-broken`?**  
A: Avoid `--skip-broken` as it may leave the system in an inconsistent state. Instead, clean the cache (`yum clean all`), verify repository configuration, and ensure you’re using compatible repositories like `epel-archive` for Alibaba Cloud Linux 3.

**Q: Is kernel hotpatching safe for production workloads?**  
A: Kernel hotpatches provided by Alibaba Cloud are tested for stability, but workloads using OverlayFS (e.g., Docker) should be monitored closely. Review the latest hotpatch release notes for known issues before applying.

**Q: How can I roll back a failed software installation?**  
A: Use `yum history` to view recent transactions, then `yum history undo <ID>` to revert a specific installation. For kernel-related changes, boot into a previous kernel version from GRUB if needed.

**Q: Where can I find logs for package manager errors?**  
A: YUM/DNF logs are stored in `/var/log/yum.log`. Detailed transaction logs can also be found in `/var/log/dnf.*` (on DNF-based systems) or via `journalctl -u dnf-makecache`.