文档首页> 弹性云服务器 ECS> 常见问题> 镜像源管理> 执行yum makecache后,下载速度变慢怎么办?
更新时间:2022-09-23 GMT+08:00
分享

执行yum makecache后,下载速度变慢怎么办?

问题描述

执行了yum makecache生成本地缓存,但下载速度变慢。

处理方法

配置EPEL源。

  • 了解EPEL源
  • 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更新软件列表。
    • 执行命令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

    • 如果使用过程中发现某些包不可用,可能是数据正在同步,请过几个小时后再重试。
分享:

镜像源管理 所有常见问题

more