CentOS8 安装epel 使用清华镜像

CentOS8和前面的不太一样,准备推出dnf(下一代yum)了,所以epel结构也和之前的CentOS7 不一样。这里经过测试给出了CentOS8 下面可用的epel几个文件,分别/etc/yum.repos.d/目录下的:

  • epel.repo
  • epel-playground.repo
  • epel-testing.repo
  • epel-testing-modular.rep
  • epel-modular.rep

下面以epel.repo为例,其他都是一样的,把metalink注释掉,baseurl换成清华的就OK了。

[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

[epel-debuginfo]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/SRPMS
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1

其实enable=0就没有必要改了。

修改把这些网址修改之后,再运行:

[root@server yum.repos.d]$ dnf repolist epel -v
加载插件:builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.2.7
cachedir: /var/cache/dnf
错误 ID repo: Base OS, byte =   4
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
仓库: 正在为 AppStream 使用缓存
AppStream:正在使用截止于 2020年03月06日 星期五 05时14分06秒 的元数据。
仓库: 正在为 extras 使用缓存
extras:正在使用截止于 2020年01月11日 星期六 02时31分29秒 的元数据。
仓库: 正在为 epel 使用缓存
epel:正在使用截止于 2020年03月07日 星期六 05时53分10秒 的元数据。
上次元数据过期检查:0:00:35 前,执行于 2020年03月09日 星期一 00时41分59秒。
Completion plugin: Generating completion cache...

仓库ID     : epel
仓库名    : Extra Packages for Enterprise Linux 8 - x86_64
仓库状态  : 启用
仓库版本: 1583531551
仓库更新: 2020年03月07日 星期六 05时53分10秒
仓库包    : 4,969
仓库大小    : 5.9 G
仓库基本地址: https://mirrors.tuna.tsinghua.edu.cn/epel/8/Everything/x86_64
仓库到期: 172,800 秒 (最近 2020年03月09日 星期一 00时41分59秒)
仓库文件名: /etc/yum.repos.d/epel.repo
软件包总数:4,969
发布了6 篇原创文章 · 获赞 0 · 访问量 603

猜你喜欢

转载自blog.csdn.net/weixin_42205230/article/details/104744588
今日推荐