How to fix yum errors on CentOS, RHEL or Fedora

Yum is a package management tool for installing, updating and removing rpm packages on RedHat-based systems. When you try to install a package withyum command, you may encounter
errors for various reasons. In this post, I will describe under what situationsyum errors can occur, and explain
how to fix yum errors.

Fix 404 errors

Symptom: When you try to install a package with yum,yum complains that the URLs for repositories are not found, and throws 404 errors, as shown below.

Loaded plugins: fastestmirror
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 4.4 MB     00:09
extras                                                   | 3.5 kB     00:00
http://mirror.steadfast.net/centos/6.4/extras/x86_64/repodata/e0e507c76dc5e5aa66c1f32632b9dc0a9759d97031ab5a028562a7cb7be6e294-primary.sqlite.bz2:
[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404
Not Found"
Trying other mirror.
http://mirrors.seas.harvard.edu/centos/6.4/extras/x86_64/repodata/e0e507c76dc5e5aa66c1f32632b9dc0a9759d97031ab5a028562a7cb7be6e294-primary.sqlite.bz2:
[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404
Not Found"
Trying other mirror.

You can get these 404 errors when the metadata downloaded by yum has become obsolete.

To repair yum 404 errors, clean yum metadata as follows.

$ sudo yum clean metadata

Or you can clear the whole yum cache:

$ sudo yum clean all

Fix connection failure errors

Symptom: You get "network is unreachable" or "couldn‘t connect to host" errors while runningyum command.

Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - "Failed to connect to
2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Error: Cannot find a valid baseurl for repo: base

http://mirror.nexcess.net/CentOS/6.4/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 7 - "couldn‘t connect to host"
Trying other mirror.
http://mirrordenver.fdcservers.net/centos/6.4/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 7 - "couldn‘t connect to host"
Trying other mirror.
http://mirrors.cmich.edu/centos/6.4/os/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 7 - "couldn‘t connect to host"
Trying other mirror.

The error means that you cannot properly connect to repository servers for some reason. If you can still ping the servers without any problem, check if your system is behind a proxy. If you are runningyum behind a proxy, but have not specified the
proxy in the yum configuration, you will get connection failure errors like the above.

To configure a proxy in the yum configuration:

$ sudo vi /etc/yum.conf

[main]
proxy=http://proxy.com:8000

Fix metadata checksum errors

Symptom: You get "Metadata file does not match checksum" while runningyum command.

epel/pkgtags                                             | 466 kB     00:14
http://mirror.steadfast.net/epel/6/x86_64/repodata/pkgtags.sqlite.gz: [Errno -1] Metadata file does not match checksum
Trying other mirror.

You can get the metadata checksum errors when the metadata downloaded by yum has become outdated.

To repair yum checksum errors, clean yum metadata:

$ sudo yum clean metadata

Fix yum lock errors

Symptom: When you run yum on Fedora, you get the errors saying that "Another app is currently holding the yum lock."

Loaded plugins: langpacks, presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 1880.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 178 M RSS (586 MB VSZ)
    Started: Tue Jul  9 09:43:17 2013 - 00:12 ago
    State  : Sleeping, pid: 1880

The culprit for this error is PackageKit which is responsible for auto updates on Fedora. ThePackageKit process gets automatically started upon boot, holding the
yum lock.

To fix the error, disable auto update checks on Fedora. In order to do so, click on "Software" on Fedora desktop to open software update preferences.

Then click on "Software Sources" menu like the following.

In the software update preferences, set "Never" for "Check for updates".

Once you reboot your desktop, you will no longer get yum lock errors.

时间: 05-18

How to fix yum errors on CentOS, RHEL or Fedora的相关文章

[转载]Install Opera 12.16 Web Browser in CentOS/RHEL and Fedora

FROM: http://tecadmin.net/install-opera-web-browser-in-centos-rhel-fedora/ Opera is an modern web browser with modern style with powerful features. Its Off-Road mode compresses pages for faster, all-conditions browsing. It helps you stay online when

Install PHP 7, Apache, MySQL 5.6 on CentOS / RHEL 7.1 & 6.7 + Wordpress

最近做了个小项目,挣了几百块钱,于是买了个域名:shawshining.com 和一个搬瓦工的服务器.搬瓦工自带CentOS6,支持一键安装ss,比较方便.买的搬瓦工的服务器只有500MB内存,导致出现一些以前在类似阿里云的学生机1g内存上根本不会出现的问题.所以有必要告诉后来人怎么填坑.事不宜迟,写个教程让大家少走点弯路.如果有问题,清查看最下面的问题解决方法.如果问题依然没有解决可以google,百度一下! 主要参考:https://tecadmin.net/install-php-7-ap

转: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (简单易懂)

from:  http://tecadmin.net/install-mongodb-on-centos-rhel-and-fedora/ MongoDB (named from “huMONGOus“) is a full flexible index support and rich queries database. Its is a NoSQL database. MongoDB provides large media storage with GridFS. Clickhere fo

PHP 5.4 on CentOS/RHEL 7.0, 6.5 and 5.10 via Yum

PHP 5.4.36 has been released on PHP.net on 18th December 2014, and is also available for CentOS/RHEL 5.10 and 6.5 at Webtatic via Yum. Update 2013-07-21 – A new package “php54w-mysqlnd” has been added as an alternative to “php54w-mysql”. This will in

[转载]PHP 5.6 on CentOS/RHEL 7.0 and 6.6 via Yum

https://webtatic.com/packages/php56/ PHP 5.6.5 has been released on PHP.net on 22nd January 2014, and is also available for CentOS/RHEL 6.5 at Webtatic via Yum. PHP 5.6 adds new features such as: constant scalar expressions variadic functions argumen

通过yum升级CentOS/RHEL最小化安装

1.如果你有安装CentOS / RHEL最小服务器安装,您可能有很多麻烦没有安装包 2.有一种方法来安装所有的包,需要一个基本的服务器,使用yum groupinstall命令 3.从最小的安装基本升级你的服务器 # yum groupinstall "Base" 4.升级你的系统Web服务器 # yum groupinstall "Web Server" 5.升级你的系统为MySQL数据库服务器 # yum groupinstall "MySQL Da

centos/RHEL 7.6 使用yum安装php7.3(方便wordpress的php7.3需求,并解决了libphp7.so缺失问题)

我最近想安装一个wordpress, 但是官网介绍需要php7.3以上版本,但是百度了一下,都是要编译安装. 为此,我想,centos..., php... 两大当红辣子鸡没有yum安装方式,简直不可能. 为此,我搜寻了各种源,发现remi源有php73. 但是我yum install 以后,发现两个致命的问题: (1)php -v 不会显示任何东西,要php73 -v 才行 (2)建立一个phpinfo的测试页,没有任何反应,据研究是apache缺乏libphp7.so模块,各种教程都让我编译

在 CentOS/RHEL 7.1, 6.7 and 5.11 版本上用yum安装 PHP 5.4

在 CentOS/RHEL 7.1, 6.7 and 5.11 版本上用yum安装 ?PHP 5.4 在CentOS 7下(包含安装EPEL) wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7*.rpm epe

Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

1. Change root user Bash su - ## OR ## sudo -i 2. Install MySQL YUM repository Fedora Bash ## Fedora 25 ## dnf install https://dev.mysql.com/get/mysql57-community-release-fc25-9.noarch.rpm ## Fedora 24 ## dnf install https://dev.mysql.com/get/mysql57