How to Fix Common yum Errors on CentOS 7: Step‑by‑Step Guide
This guide walks you through diagnosing and resolving typical yum failures on CentOS 7, covering 404 repository errors, install‑time unpacking failures, and missing Python interpreter issues with clear commands, file checks, and corrective actions.
Introduction
This article explains how to troubleshoot frequent yum command failures on a CentOS 7 system, providing concrete commands and step‑by‑step procedures.
1. yum returns a 404 error
Check that the yum repository is correctly configured, for example by downloading the official repo file from Alibaba Cloud:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoIf the error mentions the $releasever variable, verify that the centos-release package is installed: rpm -qa | grep centos-release If it is missing, download and install it:
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/centos-release-7-7.1908.0.el7.centos.x86_64.rpm
rpm -ivh centos-release-7-7.1908.0.el7.centos.x86_64.rpm2. yum install reports a failed error
Example error when installing telnet:
ERROR UNpacking rpm package 1:telnet-0.17-64.e17.x86_64
error:unpacking of archive failed on file /usr/bin/telnet;5e785bc7:cpio:openCheck the attributes of the target directory; an immutable i flag can block writes: lsattr /usr/bin Remove the immutable flag:
chattr -i /usr/binSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
