Home Tech Steps to Perform When a Centos 7 Yum Update Fails

Steps to Perform When a Centos 7 Yum Update Fails

by Danny White

When you administer a server, you have to take responsibility for your server’s security. Implementation of recent releases of security updates and patches are important to keep the system protected. 

While doing the update process, sometimes the package manager yum fails to work. This makes the update, installation, as well as removal of packages, gets difficult. In this article, we will learn about the commonest reasons for yum command failure, and ways to fix them.

No Repositories Available

The first reason for the failure of the CentOS 7 update is that the system does not allow default configuration of any yum repositories. This makes the yum package unable to update or install any package.

Solution: Verify the cause by access to the folder: /etc/yum.repos.d  Now type the below command to find if any files are present:

yum repolist all

1

yum repolist all

If they aren’t present, then make new files yourself. A Google search proves to be beneficial to locate the right repository information for the CentOS 7 version.

MONOVM VPS is the best place to learn how to update Centos 7. The company uses the latest virtualization technologies to develop innovative and feature-rich software for users. All their efforts are intended to provide the best level of convenience and customer satisfaction to users.

Disabled Repositories

The next thing that you can do is when the epel repository is in a configured but disabled state. This is difficult to troubleshoot as no error message is shown. Try installing a package. It may fail as yum isn’t able to locate it.

Here is an illustration of a disabled repository present in the file /etc/yum.repos.d/epel.repo:

[epel]

Name=Extra Packages for Enterprise Linux 7-$basearch

#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch

metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

failovermethod=priority

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

1

2

3

4

5

6

7

8

[epel]

name=Extra Packages for Enterprise Linux 7 – $basearch

#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch

metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

failovermethod=priority

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Solution: Change the value to 1, and again execute yum update command to refresh the list of package. Once done, again install the software that you need.

Broken Repositories

Broken repositories can also be the reason why the entire yum package would fail. This can happen due to a typo in the repositories or configuration files. It can also happen when they longer exist or have changed their location (URL).

Solution: Edit the file information in /etc/yum.repos.d.  Rectify the error or disable the damaged repository so as the remaining update task gets finished.

Dependency Conflicts

Another reason why a package could not install is that when a dependency isn’t found or is at an incorrect version. 

Solution: This is a complex issue that has no general fix. You need to manually install the missing dependencies, and run the initial command again. To solve the version conflicts, uninstall the package on the system. Configure an additional repository that has the right dependency.

Conclusion

Implementing security practices on the Linux server is not a one-time task. This is a very significant task in managing a server and maintaining its security. For this reason, it is important to quickly identify any error in the system update utility and resolve them at the earliest.

 

You may also like

Leave a Comment

Enter Captcha Here : *

Reload Image