Centos7配置yum国内源(BaseOS+epel+ELRepo+SCL+IUS+REMI)
基于 RHEL 的八个 YUM/DNF 第三方存储库
参考:https://blog.csdn.net/weixin_54626591/article/details/138283475
- # 安装epel源和ELRepo源(依赖epel源)
- yum install -y epel-release elrepo-release
- # 安装SCL源
- ## centos-release-scl centos-release-scl-rh是SCL源
- ## scl-utils scl-utils-build是SCL-utils工具
- yum install -y centos-release-scl centos-release-scl-rh scl-utils scl-utils-build
- # 安装IUS源(依赖依赖epel源)
- ## 导入IUS源gpg key
- rpm --import https://repo.ius.io/RPM-GPG-KEY-IUS-7
- ## 安装IUS源
- yum install -y https://repo.ius.io/ius-release-el7.rpm
- # 安装REMi源
- yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- # 查看repolist
- yum repolist
复制代码
配置底子源
该源包罗base,updates,epel,会主动匹配Centos系统版本
参考:https://blog.csdn.net/weixin_54626591/article/details/138283757
- [base]
- name=CentOS-$releasever - Base
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
- baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- #released updates
- [updates]
- name=CentOS-$releasever - Updates
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
- baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
- baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever - Plus
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
- baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
复制代码 配置base源
参考:https://blog.csdn.net/weixin_54626591/article/details/138284024
参考:https://blog.csdn.net/weixin_54626591/article/details/138284147
- # 备份Base.repo
- sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
复制代码 下载阿里云的base源
- # 下载阿里云的base源
- wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
复制代码- # 如果没有wget程序则使用curl下载
- curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
复制代码 下载163的base源
- # 下载163的base源
- wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
复制代码- # 如果没有wget程序则使用curl下载
- curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
复制代码 刷新源
- # 快速生成缓存
- sudo yum makecache fast
复制代码- # 生成完整缓存
- sudo yum clean all && sudo yum makecache
复制代码 检察源是否添加成功
- # 查看yum源是否添加成功
- sudo yum repolist
复制代码 安装epel源
Extra Packages for Enterprise Linux缩写为epel;
epel源中有许多高质量的扩展软件,例如: htop,ncdu,nginx,vnstat
修改为清华源
- # 安装epel源
- yum install epel-release -y
复制代码- # 手动安装
- rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
复制代码- # 备份epel.repo
- mv /etc/yum.repos.d/epel.repo epel.repo{,.bak}
复制代码- # 直接下载epel.repo
- wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
- # 或
- curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
- # 有时候aliyun会抽风连不上,可以换用其他国内源
- curl -o /etc/yum.repos.d/epel.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
复制代码
替换epel.repo文件
实用于RHEL7
手动创建epel.repo,将下方配置3选1粘贴到epel.repo
- # 手动编辑epel.repo文件
- vim /etc/yum.repos.d/epel.repo
复制代码 配置内容如下
- # 中科大的epel源---建议
- [epel-USTC]
- name=epel-USTC--CentOS-$releasever
- baseurl=https://mirrors.ustc.edu.cn/epel/$releasever/$basearch/
- enabled=1
- gpgcheck=0
复制代码- # 华为云的epel源
- [epel-huaweicloud]
- name=epel-huaweicloud-CentOS-$releasever
- baseurl=https://mirrors.huaweicloud.com/epel/$releasever/$basearch/
- gpgcheck=0
复制代码- # 清华的epel源
- [epel-tsinghua]
- name=Extra Packages-tsinghua for Enterprise Linux $releasever - $basearch
- baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/$basearch
- #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
- failovermethod=priority
- enabled=1
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
复制代码 生存
刷新源
- # 快速生成缓存
- sudo yum makecache fast
复制代码- # 生成完整缓存
- sudo yum clean all && sudo yum makecache
复制代码 检察源是否添加成功
- # 查看yum源是否添加成功
- sudo yum repolist
复制代码 从epel源中安装软件
- # 安装htop
- yum install -y htop
复制代码 安装ELRepo源
用来更新内核,Centos7的内核默认只到3.10,这个源可以更新到最新的内核.例如5.4
https://blog.csdn.net/weixin_54626591/article/details/138282401
安装SCL源
https://blog.csdn.net/weixin_54626591/article/details/138412076
安装IUS源
为RHEL和CentOS提供高质量、最新版的软件,如PHP, Python, MySQL等。
参考文章:https://blog.csdn.net/weixin_54626591/article/details/138438337
安装REMI源
Remi源中的软件险些都是最新稳固版,这些都是Linux骨灰级的玩家编译好放进源里的.
Remi下载地点:http://rpms.famillecollet.com/
参考: https://wsgzao.github.io/post/epel/
- # Centos7安装remi源
- yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
复制代码- # Centos7安装REMI源(国内安装)
- yum install -y https://mirrors.aliyun.com/remi/enterprise/remi-release-7.rpm
复制代码- # rhel8安装remi源
- yum install -y http://rpms.famillecollet.com/enterprise/remi-release-8.rpm
复制代码 安装raven源
源项目地点:https://pkgs.dyn.su/
参考:https://sysadmins.ws/viewtopic.php?f=96&t=22598&sid=b17673c41ea6e1a8f6ccb9b39bbf967c
rhel8安装raven源
- dnf localinstall -y https://pkgs.dyn.su/el8/base/x86_64/raven-release.el8.noarch.rpm
复制代码 RHEL7配置raven源
- [raven]
- name=Raven's Packages for EL
- baseurl=http://pkgs.dyn.su/$releasever/base/$basearch/
- enabled=1
- gpgcheck=0
- [raven-httpd]
- name=Raven's httpd build for EL
- baseurl=http://pkgs.dyn.su/$releasever/httpd/$basearch/
- enabled=0
- gpgcheck=0
- [raven-extras]
- name=Raven's Extra Packages for EL
- baseurl=http://pkgs.dyn.su/$releasever/extras/$basearch/
- enabled=0
- gpgcheck=0
- [raven-testing]
- name=Raven's Unstsble Packages for EL
- baseurl=http://pkgs.dyn.su/$releasever/testing/$basearch/
- enabled=0
- gpgcheck=0
复制代码 其他国内常用源
参考: https://wiki.centos.org/zh/AdditionalResources/Repositories
启用禁用的源
- # 启用PowerTools源
- sudo yum config-manager –set-enabled PowerTools
复制代码 使用指定的yum仓库安装包
- # 从指定的yum仓库中安装包
- yum --enablerepo=repo名 install 包名
复制代码- # 从所有yum仓库中安装包
- yum --enablerepo=* install 包名
复制代码- # 禁止从指定的yum仓库中安装包
- yum --disablerepo=repo名 install 包名
复制代码
识途老码
Centos7配置yum国内源(BaseOS+epel+ELRepo+SCL+IUS+REMI)
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |