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.

最新文章

  1. iOS深入学习(Block全面分析)
  2. bzoj1904: Musical Water-fence
  3. CentOS与ubuntu添加eclipse桌面快捷方式的方法整理
  4. Mysql基本数据操作
  5. extern 关键字
  6. 转:C#精髓 第四讲 GridView 72般绝技
  7. C# TextBox中只允许输入数字的方法
  8. HDU 4825-Xor Sum(trie)
  9. 关于PIL库的一些概念
  10. ##DAY7 UINavigationController
  11. Windows Phone 8初学者开发—第14部分:在运行时绑定到真实的数据
  12. 散文说python半篇——景观三元论与盖茨比的对话
  13. String和StringBuilder的使用
  14. zoj1494 暴力模拟 简单数学问题
  15. bootstrap-select多选下拉列表插件使用小记
  16. 关于通过ruby互联网同步时间的几个思路
  17. PythonStudy——Python 内置函数 Built-in function
  18. [leetcode]17. Letter Combinations of a Phone Number手机键盘的字母组合
  19. ADO.NET 【类库】【与数据库的连接】
  20. 运用fancybox弹出div的方式弹出视频界面

热门文章

  1. 1.ArcGis几何图形之几何计算
  2. 1、Visual Studio Code安装及Hello Word
  3. 能够附加图片的标签控件iOS项目源码
  4. Java_Web之Servlet基础
  5. java多线线程停止正确方法
  6. 时序分析:ARIMA模型(非平稳时间序列)
  7. 【sqli-labs】 less42 POST -Error based -String -Stacked(POST型基于错误的堆叠查询字符型注入)
  8. (转)OL记载Arcgis Server切片
  9. String类练习统计一个字符串中大小写字母及数字字符个数
  10. 【转载】java list的一些基本操作