美文网首页
常用yum源介绍及配置

常用yum源介绍及配置

作者: Zhang21 | 来源:发表于2017-10-24 16:40 被阅读745次

参考:


rpm包管理方式,对于安装、升级、卸载却难以处理包之间的依赖关系。而yum作为一个rpm包前端管理工具,可以自动处理依赖性,并支持在线现在、安装、升级、卸载rpm软件包。



国内开源镜像站点



CentOS自带源

CentOS默认自带CentOS-Base.repo源,但官方源在国外,连接速度令人心痛。并且有很多软件在默认源里面是找不到的。

配置网络yun源

配置aliyun.repo:

#先备份默认源
mv CentOS-Base.repo{,.bak}

#下载阿里云源替换默认源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all
yum makecache    #重构yum缓存

yum repolist    #查看yum仓库

配置本地yum源

配置本地yum源,考虑到优先使用本地安装包,所以会涉及到一个优先级的概念。

安装完毕后,就可以在yum源中添加一个优先级priority

安装yum优先级插件:

yum install -y yum-plugin-priorities 

#检查安装完成后配置
vim /etc/yum/pluginconf.d/priorities.conf

enable=1
#enable=0

创建本地yum源:

mv /etc/yum.repos.d/CentOS-Base.repo{,.bak}

vim /etc/yum.repos.d/CentOS-Local.repo

[base-Local]
name=Centos- Local
baseurl=file:///mnt/xxx
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
priority=1    #优先级为1

[updates-Local]
name=CentOS- Local
gpgcheck=0
baseurl=file:///dir/path/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
priority=1

······
#具体可参考CentOS-Base.repo
#可将aliyun源优先级写成2

yum clean all
yum makecache

配置ftp方式源

vim /etc/yum.repos.d/ftp.repo

[ftp-media]
name=name=CentOS-$releasever - media
baseurl=ftp://ip
gpgcheck=0
enable=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

yum clean all
yum makecache



其他常见YUM源

官方的默认yum源提供的软件包往往是很滞后的,(可能为了服务器版本的稳定性和安全性)。并且官方默认源提供的RPM包也不够丰富。

EPEL源

EPEL的全称叫 Extra Packages for Enterprise Linux 。EPEL是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。装上了 EPEL之后,就相当于添加了一个第三方源。

EPEL源为服务器提供了大量的rpm包(这些包可能有很多在默认源中没有),并且绝大多数rpm包比官方默认源版本要新。

添加epel源:
epel下载地址:http://download.fedora.redhat.com/pub/epel/

rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

#yum install -y epel-release

remi源

Remi源大家或许很少听说,不过Remi源GoFace强烈推荐,尤其对于不想编译最新版的linux使用者,因为Remi源中的软件几乎都是最新稳定版。
或许您会怀疑稳定不?
放心,这些都是Linux骨灰级的玩家编译好放进源里的,他们对于系统环境和软件编译参数的熟悉程度毋庸置疑。

添加remi源:
Remi下载地址:http://rpms.famillecollet.com

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

#yum install -y  http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

RPMForge源

RPMForgeCentOS 系统下的软件仓库, 拥有 4000 多种的软件包, 被 CentOS 社区认为是最安全也是最稳定的一个软件仓库。

添加RPMForge源:
RPMForge下载地址:http://repository.it4i.cz/mirrors/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/
GitHub:https://github.com/repoforge

rpm -ivh http://repository.it4i.cz/mirrors/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

#yum localinstall --nogpgcheckhttp://repository.it4i.cz/mirrors/repoforge/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

相关文章

  • 常用yum源介绍及配置

    参考: CentOS 7下配置本地yum源及yum客户端 Centos7 配置本地源+阿里yum源/epel-yu...

  • CentOS笔记

    yum常用命令 yum配置本地源 配置RPM源 挂载系统ISO镜像 (将ISO文件上传到/usr/local) 修...

  • PHP5.6 的安装与卸载

    1、配置yum源 CentOS 6.5 追加epel及remi源 CentOS 7.0 追加epel及remi源 ...

  • php5.6 install

    配置yum源 追加CentOS 6.5的epel及remi源。 以下是CentOS 7.0的源。 使用yum li...

  • CentOS 7 安装php5.6

    CentOS 7 yum 安装php5.6 配置yum源 追加CentOS 6.5的epel及remi源。 # r...

  • Centos Issue

    CentOS配置本地Yum源、阿里云Yum源、163Yum源、并配置Yum源的优先级

  • 使用二进制文件安装k8s

    服务器信息 官网及下载地址 配置yum源/etc/yum.repos.d/kubernetes.repo 配置阿里...

  • CentOS6 yum仓库配置

    yum 常用命令 配置网络版yum源 1、访问http://mirrors.163.com/.help/cento...

  • 在CentOS安装PHP5.6

    配置yum源 追加CentOS 6.5的epel及remi源。 # rpm -Uvh http://ftp.iij...

  • Centos7配置PHP + MySQL + Nginx

    一. MySQL安装与配置 1. 配置yum源 # 更新yum源 yum update # 下载mysql源安装包...

网友评论

      本文标题:常用yum源介绍及配置

      本文链接:https://www.haomeiwen.com/subject/fqutpxtx.html