分享交流
合作共赢!

Linux常用基础命令使用总结【九】——epel源和yum源配置

EPEL源

一、EPEL简介

EPEL (Extra Packages for Enterprise Linux), 是由 Fedora Special Interest Group 维护的 Enterprise Linux(RHEL、CentOS)中经常用到的包。

二、配置方法

1. 备份(如有配置其他epel源)

mv /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. 下载新repo 到/etc/yum.repos.d/

epel(RHEL 8)
1)安装 epel 配置包

yum install -y 
https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm

2)将 repo 配置中的地址替换为阿里云镜像站地址

sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

epel(RHEL 7)

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

epel(RHEL 6)

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

epel(RHEL 5)

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

阿里云下载地址:https://mirrors.aliyun.com/epel/

阿里云YUM源

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行yum makecache生成缓存

其他yum源:

  • https://repos.fedorapeople.org/repos/candlepin/subscription-manager/epel-7/x86_64/
  • https://vault.centos.org/7.8.2003/extras/x86_64/
  • http://mirror.centos.org/centos/7/updates/x86_64/Packages/
  • https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/
  • http://rpms.adiscon.com/v8-stable-daily/rhel-8/x86_64/RPMS/
  • 例如:[ubi-8-baseos]
    name = Red Hat Universal Base Image 8 (RPMs) – BaseOS
    baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/baseos/os

    [ubi-8-appstream]
    name = Red Hat Universal Base Image 8 (RPMs) – AppStream
    baseurl = https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/$basearch/appstream/os

赞(0) 打赏
未经允许不得转载:琼杰笔记 » Linux常用基础命令使用总结【九】——epel源和yum源配置

评论 抢沙发

评论前必须登录!

 

分享交流,合作共赢!

联系我们加入QQ群

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册