Centos yum源的位置:

/etc/yum.repos.d,可以通过配置文件/etc/yum.conf指定其他位置

主要的yum源种类:前两个是必须的,不然yum安装很多软件时会失败。yum本来是智能解决软件之间的依赖,但是如果源太少,就导致查不到所需依赖。

  • epel
  • CentOS-Base
  • nginx:http://nginx.org/en/linux_packages.html#RHEL-CentOS
  • Remi源:centos7、centos6

    rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm
    rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-6.rpm
  • 有些软件使用yum安装,需要先找到并指定这个软件的yum源

epel源安装:

安装完成之后会在目录/etc/yum.repos.d生成epel.repo

yum -y install epel-release
yum clean all  # 清除系统所有的yum缓存
yum makecache  # 生成yum缓存

导入相应的key,不然安全某些软件时会校验失败:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

安装时不校验:

yum install xx --nogpgcheck

gpgcheck=0

rpm -i --nosignature

 
 

切换到国内源:以阿里源举例

wget http://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo # 下载阿里开源镜像的epel源文件

国内源:

网易镜像源:http://mirrors.163.com/.help/centos.html

阿里镜像源:https://opsx.alibaba.com/mirror?lang=zh-cn

repo文件含义:

[epel]
name=Extra Packages for Enterprise Linux - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch # 源地址
metalink=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 # 校验文件的位置

参考:

https://blog.csdn.net/inslow/article/details/54177191

https://www.jianshu.com/p/d2ecad045c54

https://blog.51cto.com/xiaocao13140/2105528

Centos yum国内源及配置含义的更多相关文章

  1. CentOS 7 国内源配置

    CentOS 7 国内源配置 1. 备份自带源 # 首先要确认你有 wget 命令, 并且连着网 # cd /etc/yum.repos.d/ # mkdir repo # mv *.repo rep ...

  2. 在Kali linux下使用docker配置sqli-labs(国内源的配置和系统软件更新)

    本篇blog导航: ~前言 ~第一步:在安装好的kali配置国内源 ~第二步:安装docker ~第三步:docker下安装sqli-labs ~写在最后. 前言: 最近闲来无事,在闯关sqli-la ...

  3. (实用)Ubuntu 、CentOS更换国内源

    Ubuntu更换apt-get源 通过编辑/etc/apt/sources.list文件,我们能够更换Ubuntu的默认软件更新源.通常是将其换成一些国内比较知名的源.本文主要列举这些内容. 注意,在 ...

  4. fedora国内源常见配置

    yum install yum-fastestmirror3.rpmfusion源 rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfus ...

  5. centos yum 安装jdk后配置JAVA_HOME

    centos6.4 yum 安装jdk和JAVA_HOME的设置 2014-06-17 16:13 1176人阅读 评论(0) 收藏 举报  分类: linux(3)  版权声明:本文为博主原创文章, ...

  6. [转]fedora国内源常见配置

    1.参考:1.http://mirrors.ustc.edu.cn/2.http://mirrors.fedoraproject.org/publiclist#CN3.http://mirrors.n ...

  7. pip使用国内源的配置方法

    [root@ ~]# cat ~/.pip/pip.conf [global] index-url = https://pypi.douban.com/simple

  8. pip 国内源 包管理

    配置国内源 linux配置 修改 ~/.pip/pip.conf 文件,如下,添加了源并修改了默认超时时间 [global] timeout = 3000 index-url = http://mir ...

  9. CentOS 配置国内源

    阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ CentOS系统更换软件安装源 第一步 备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repo ...

随机推荐

  1. cactiEZ 配置

    CactiEZ 中文版是简单有效的cacti中文解决方案,它基于centos6 整合了cacti的相关软件,重新编译的一个新的操作系统 它基于centos6,启动速度快,支持EXT4文件系统,全中文页 ...

  2. BZOJ1911 [Apio2010]特别行动队 - 动态规划 - 斜率优化

    欢迎访问~原文出处——博客园-zhouzhendong 去博客园看该题解 题目传送门 UPD(2018-04-01):用Latex重打了公式…… 题意概括 把一个整数序列划分成任意连续的段,使得划分出 ...

  3. 数学建模:2.监督学习--分类分析- KNN最邻近分类算法

    1.分类分析 分类(Classification)指的是从数据中选出已经分好类的训练集,在该训练集上运用数据挖掘分类的技术,建立分类模型,对于没有分类的数据进行分类的分析方法. 分类问题的应用场景:分 ...

  4. fastAdmin进阶

    基本知识流程一栏链接 bootstrapTable fastadmin系统配置(符内置规则): fastadmin默认的controller已实现的方法 一张图解析fastadmin的表格: fast ...

  5. To the Max POJ - 1050 (最大子段和)

    Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous s ...

  6. PHP 对POST数据的处理

    // 获取body中json数据并初始化为数组$data = json_decode(file_get_contents('php://input'), true);

  7. emitted value instead of an instance of error the scope attribute for scoped slots webpack babel polyfill

    api20180803.vue emitted value instead of an instance of error the scope attribute for scoped slots h ...

  8. 2186 ACM 水题 int 向下取整

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=2186 扩展: #include <cstdio> 使用floor函数.floor(x)返回的是 ...

  9. C# 结合html5 批量上传文件和图片预览

    html5 新特性 <input id="imgsf" type="file" name="imgsf" multiple /> ...

  10. LeetCode(15. 三数之和)

    问题描述 给定一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?找出所有满足条件且不重复的三元组. 注意:答案中不可以包含重复 ...