关键词:yum源,本地yum源,网络yum源
 

【1】配置本地yum源

  1、挂载好光盘到/redhat/mnt/mnt下
    mount /dev/cdrom /mnt
  2、操作

    cd /etc/yum.repos.d/

    ll

     

    #新建一个文件,修改内容

    vim base.repo

    

  代码参考:

echo "/dev/sde /mnt btrfs defaults 0 0" >> /etc/fstab

添加repo文件

cp CentOS7-Base-.repo local_yum.repo 复制一个原来的repo源

vim local_yum.repo 编辑

添加以下内容到local_yum.repo

[local_yum]
name=local_yum
baseurl=file:///mnt
gpgcheck=
enabled= yum clean all 清空缓存
 

【2】配置网络yum源

 
参考于:
http://mirrors.aliyun.com/help/centos?spm=5176.bbsr150321.0.0.d6ykiD
 
1、备份原文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
2、下载新的repo文件
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
网易源centos6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@rac1 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2017-10-14 23:18:31-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
正在解析主机 mirrors.163.com... 123.58.190.209, 123.58.190.228, 123.58.190.234, ...
正在连接 mirrors.163.com|123.58.190.209|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2006 (2.0K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo” 100%[=========================================================>] 2,006 --.-K/s in 0.001s 2017-10-14 23:18:31 (1.90 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2006/2006])
----------
下载成功后,加载缓存
yum clean all
yum makecache
#yum update
#清除原来的源配置

[root@localhost ~]# yum clean all

#更新yum源到本地 [root@localhost ~]# yum list #安装现在的yum源,这一步也是测试新安装的yum源有没有安装成功 [root@localhost ~]# yum install yum
---------- 
 
 
 
 
3、如果报域名解析失败:
[root@RAC01 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
--2017-10-14 01:22:16-- http://mirrors.aliyun.com/repo/Centos-6.repo
正在解析主机 mirrors.aliyun.com... 失败:域名解析暂时失败。
wget: 无法解析主机地址 “mirrors.aliyun.com”
4、新增dns域名地址
新增下面一条内容:
[root@RAC01 yum.repos.d]# vi /etc/resolv.conf 
nameserver 8.8.8.8
5、生成缓存
[root@RAC01 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.7 kB 00:00
base/group_gz | 226 kB 00:00
base/filelists_db | 6.4 MB 00:02
base/primary_db | 4.7 MB 00:01
base/other_db | 2.8 MB 00:00
extras | 3.4 kB 00:00
extras/filelists_db | 25 kB 00:00
extras/prestodelta | 1.3 kB 00:00
extras/primary_db | 29 kB 00:00
extras/other_db | 30 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 2.9 MB 00:00
updates/prestodelta | 130 kB 00:00
updates/primary_db | 4.7 MB 00:01
updates/other_db | 66 MB 00:18
Metadata Cache Created
6、ok。
 

【3】epel源

EPEL源-是什么?为什么安装?

 EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.

使用很简单:
. 首先需要安装一个叫”epel-release”的软件包,这个软件包会自动配置yum的软件仓库。当然你也可以不安装这个包,自己配置软件仓库也是一样的。 #用于RHEL5系列
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release--.noarch.rpm #用于RHEL6系列
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh epel-release--.noarch.rpm . 安装完成之后你就可以直接使用yum来安装额外的软件包了
yum clean all yum makecache
yum install nginx pure-ftpd .直接自己手工添加软件仓库配置文件
vi /etc/yum.repos.d/epel.repo [epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-releasever&arch=releasever&arch=basearch
enabled=
gpgcheck= CentOS6.5添加阿里云的EPEL源
yum localinstall --nogpgcheck http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm 安装阿里云EPEL源
、首先卸载以前装的epel以免影响
rpm -e epel-release
、 下载阿里提供的epel
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
、yum clean all
、yum makecache 阿里云源安装示例:
、备份(如有配置其他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 、下载新repo 到/etc/yum.repos.d/
epel(RHEL )
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo epel(RHEL )
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo epel(RHEL )
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo 来源:https://www.cnblogs.com/fps2tao/p/7580188.html

yum源配置、epel源配置的更多相关文章

  1. centos7 升级php7 添加配置epel源 报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again

    文章来自:循序渐渐linux:基础知识 一书 7.3章LAMP服务器搭建 日常故障 centos上好多软件升级需要配置epel源 其中有一点小插曲 需要手动更改 1.很多时候,对PHP环境要求较新的版 ...

  2. linux 配置本地yum源,配置国内yum源,配置epel源

    目录 一.配置本地yum源 二.配置国内yum源和epel源 一.配置本地yum源 1.挂载ISO镜像 mount -o loop /mnt/yum-iso/CentOS-7-x86_64-DVD-1 ...

  3. CentOS 6.9配置EPEL源

    简介: EPEL是一个由特别兴趣小组创建.维护并管理的,针对 红帽企业版 Linux(RHEL)及其衍生发行版(比如 CentOS.Scientific Linux.Oracle Enterprise ...

  4. CentOS配置epel源

    https://opsx.alibaba.com/mirror epel 配置方法 1.备份(如有配置其他epel源) mv /etc/yum.repos.d/epel.repo /etc/yum.r ...

  5. CentOS 配置epel源

    先查询下有没有epel rpm -qa|grep epel 没有的话到官网https://fedoraproject.org/wiki/EPEL下载rpm包 然后 rpm -ivh 安装 安装完毕后到 ...

  6. redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO,愿网上少一点垃圾教程误人子弟

    都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...

  7. redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO

    都知道redhat不收费,但是其yum服务是要收费的,不想出钱那就自己配置yum源就好了. 首先,博主之前也没用过redhat,第一次用yum装包的时候提示什么没注册之类的,balaba一大堆,然后就 ...

  8. Linux 配置163yum源epel 源

    今天一个小伙伴询问博主,想换个163源(阿里源.亚马逊应该都是一样,博主没有一一验证)怎么换!博主当然兴致勃勃的准备好了指点小伙伴...但是,你没猜错,打脸了.而且最后还是和小伙伴一起配置好的,所以就 ...

  9. CentOS 本地和网络yum源简单说明及配置

    1.简述 Yellow dog Updater, Modified由Duke University团队,修改Yellow Dog Linux的Yellow Dog Updater开发而成,是一个基于R ...

  10. CentOS6、CentOS7配置Base源和epel源

    1.用yum安装软件报错 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&a ...

随机推荐

  1. jquery unload方法 语法

    jquery unload方法 语法 作用:当用户离开页面时,会发生 unload 事件.具体来说,当发生以下情况时,会发出 unload 事件:点击某个离开页面的链接在地址栏中键入了新的 URL使用 ...

  2. 性能指标:TPS 并发数 响应时间 QPS

    响应时间(RT)reponse time指系统对请求作出响应的时间.一般关注平均响应时间和最大响应时间.对于单机没有并发操作的应用系统而言,普遍认为响应时间是一个合理且准确的性能指标,但响应时间并不能 ...

  3. iPhone/iPad调整事件递交

    UIKit 为应用程序提供了编程手段来简化事件处理或者完全关闭事件流.下面的列表总结了这些方法: 关闭触摸事件的递交. 缺省情况下,视图接收触摸事件,但是你可以设置它的userInteractionE ...

  4. Python使用otp实现二步验证

    https://www.cnblogs.com/lori/p/11077161.html https://blog.coding.net/blog/two-factor-authentication ...

  5. 移动端隐藏scroll滚动条::-webkit-scrollbar

    ::-webkit-scrollbar {/*隐藏滚轮*/ display: none; } CSS3自定义滚动条样式 -webkit-scrollbar 前言 webkit支持拥有overflow属 ...

  6. Python 之目录处理

    目录处理 OS目录处理目录-->路径,文件夹 文件:txt 1. 新建和删除一个目录 import os #引入os目录from xx import xx os.mkdir("D:\\ ...

  7. python全栈开发第7天 nginx服务器和nfs的搭建及组成集群的方法

    作业一:nginx服务 二进制安装nginx包 1.使用命令:yum install epel-release -y ,来安装epel,安装成功如下图:(因为我用32位的centos7老是出现各种各样 ...

  8. win10搜索框突然不能使用了

    备忘: win10搜索不出来了,使用以下方法恢复了,备忘下 1,首先打开任务管理器 重新启动wservice服务 2.发现这时候搜索依然不能使用 然后重新启动explorer.exe (1)右键关闭该 ...

  9. Cookie实战案例代码

    import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.s ...

  10. Tag 标签

    用于标记和选择. 基础用法 由type属性来选择tag的类型,也可以通过color属性来自定义背景色. <el-tag>标签一</el-tag> <el-tag type ...