
# 执行yum makecache后，下载速度变慢怎么办？
#### 问题描述
执行了**yum makecache**生成本地缓存，但下载速度变慢。
#### 处理方法
配置EPEL源。
- 了解[EPEL源](https://fedoraproject.org/wiki/EPEL/zh-cn)。
- EPEL的仓库地址：https://repo.huaweicloud.com/epel/
 
#### 约束与限制
本节操作适用于x86_64架构的云服务器。
#### 操作步骤
1. 执行以下命令，备份配置文件。 **cp -a /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup**
   **mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup**
   
2. 修改epel.repo文件。 执行以下命令，取消baseurl开头的行的注释；增加mirrorlist开头的行的注释；将文件中的http://download.fedoraproject.org/pub替换成https://repo.huaweicloud.com。
   **sed -i "s/#baseurl/baseurl/g" /etc/yum.repos.d/epel.repo**
   **sed -i "s/metalink/#metalink/g" /etc/yum.repos.d/epel.repo**
   **sed -i "s@http://download.fedoraproject.org/pub@https://repo.huaweicloud.com@g" /etc/yum.repos.d/epel.repo**
   
3. 执行**yum update** 更新软件列表。
   ![](https://support.huaweicloud.com/ecs_faq/public_sys-resources/note_3.0-zh-cn.png)
   - 执行命令**yum makecache** 后，如果回显信息为"Another app is currently holding the yum lock"，则需执行命令**rm -rf /var/run/yum.pid** 删除yum.pid文件，然后再执行命令**yum makecache**生成缓存。
   
   - 执行命令**yum makecache** 后，如果回显报错"Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again"，则需执行以下命令，更新证书临时禁用epel源即可。
     **yum --disablerepo=epel -y update ca-certificates**
     
   
   - 如果使用过程中发现某些包不可用，可能是数据正在同步，请过几个小时后再重试。
     
 
