1、本地源配置:cdiso.repo

将iso镜像文件中所有内容复制到/public/software/cdrom 中,节点将本地yum指向此处。

[root@node19 ~]# vim /etc/yum.repos.d/cdiso.repo

[cd1]

name=cd1

baseurl=file:///public/software/cdrom

enabled=

gpgcheck=

2、本地源配置:file.repo

mount -o loop xxxx.iso /mnt/iso

如果/etc/yum.repos.d/下面有其它的*.repo文件,先创建个备份文件夹,将这些repo先转移到文件夹中,自己写一个新的.repo的文件

vi /etc/yum.repos.d/file.repo

添加如下内容:

[base]
name=rhel6repo
baseurl=file:///mnt/iso
enabled=
gpgckeck=
gpgkey=file:///mnt/iso/RPM-GPG-KEY-redhat-release .清除cache yum clean all .验证是否成功 yum -y install tree tree

3、网络源配置

# cat /etc/yum.repos.d/cent6-epel.repo
[base]
name=CentOS- - Base - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=&repo=os
gpgcheck=
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS- - Updates - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/6/updates/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=&repo=updates
gpgcheck=
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS- - Extras - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/6/extras/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=&repo=extras
gpgcheck=
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS- - Plus - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/6/centosplus/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS- - Contrib - mirrors.ustc.edu.cn
baseurl=http://mirrors.ustc.edu.cn/centos/6/contrib//
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 [epel]
name=Extra Packages for Enterprise Linux -
baseurl=http://mirrors.ustc.edu.cn/epel/6/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=
failovermethod=priority
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [epel-debuginfo]
name=Extra Packages for Enterprise Linux - - Debug
baseurl=http://mirrors.ustc.edu.cn/epel/6/x86_64/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=
failovermethod=priority
enabled=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck= [epel-source]
name=Extra Packages for Enterprise Linux - - Source
baseurl=http://mirrors.ustc.edu.cn/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=
failovermethod=priority
enabled=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=
测试是否正常运行
yum list

linux yum配置本地iso镜像的更多相关文章

  1. 【转载】Linux 通过mount -o loop 配置本地.iso镜像为yum源(yum仓库)

    原文地址:https://www.jb51.net/os/RedHat/2682_all.html 如果拷贝到本地,可以使用mount mount fileName mountPoint -o loo ...

  2. yum管理——搭建iso镜像私有yum源仓库(1)

    在服务器上一般是没有光驱的,那么我们怎么制作iso本地repo镜像源仓库? 通过本地iso镜像,copy到linux系统中一个目录中,进行伪文件系统挂载,执行如下命令: 挂载:mount -o loo ...

  3. 挂载本地iso镜像

    挂载本地iso镜像 [root@linux-node1 ~]# mkdir -p /disk/iso [root@linux-node1 ~]# cd /disk/iso/ [root@linux-n ...

  4. Linux操作系统各版本ISO镜像下载(包括oracle linux\redhat\centos\u

    Linux操作系统各版本ISO镜像下载(包括oracle linux\redhat\centos\ubuntu\debian等) 1.Oracle Linux(下载地址) (1)OracleLinux ...

  5. CentOS7 配置光盘iso镜像为本地yum源

    因为系统使用的最小化安装,所以很多软件没有安装上,又无法上网,为了方便,所以直接将上传的iso镜像直接作为yum源. 我已经将光盘的iso镜像上传至服务器. 接下来就是将iso的光盘镜像进行挂载了 m ...

  6. centos 7.6镜像_Centos7 配置本地yum源为iso镜像

    创建挂载路径 sudo mkdir /media/iso 挂载ISO镜像到目录 sudo mount -o loop CentOS-7-x86_64-Minimal-1810.iso /media/i ...

  7. RedHat Linux RHEL6配置本地YUM源

    YUM是Yellow dog Updater Modified的简称,起初是由yellow dog这一发行版的开发者Terra Soft研发,用python写成,那时还叫做yup(yellow dog ...

  8. Linux虚拟机配置本地yum源

    刚开始使用Linux,自己构建了一个Linux虚拟机之后,在使用yum install的时候,经常是出错,提示连接不上. 一直以为是自己构建的虚拟机的问题,后来在网上查找了一些资料,才发现:需要配置本 ...

  9. [Linux]Redhat7配置本地镜像源

    一.Redhat7源 上一个文章介绍了如何配置的Redhat7的YUM网络源:[Linux]Redhat7配置CentOS7 YUM源 .如果在无法联网的情况下,可以使用镜像文件作为源安装需要的包. ...

随机推荐

  1. finecms在任意页面调用栏目名称和地址等

    finecms如何调用栏目名称和地址呢?在任意页面.我们有时需要在不同的页面调用某个栏目名,怎么调用比较快呢?ytkah整理了一些快速调用语句方便查找 栏目名称:{dr_cat_value(栏目id, ...

  2. 微信小程序github源码

    https://github.com/justjavac/awesome-wechat-weapp https://www.cnblogs.com/tuyile006/p/6268961.html h ...

  3. (转)深度教程:POS和POW全解析

    如果你是一名资深的比特币矿工或商人,你一定听说过POW和POS,但是当前在国内,却几乎没有人明白这到底是什么意思,也几乎没有相关的中文资料,小编吐血撰写,是为了让大家更好理解这些概念.   读完本文, ...

  4. 第一弹:超全Python学习资源整理(入门系列)

    随着人工智能.大数据的时代到来,学习Python的必要性已经显得不言而喻.我经常逛youtube,发现不仅仅是以编程为职业的程序员,证券交易人员,生物老师,高级秘书......甚至许多自由撰稿人,设计 ...

  5. UML序列图的理解:

    UML序列图的理解:UML序列图是指一个对象的方法在处理过程中调用其他对象的图:重点是要突出调用其他对象的序列:

  6. koa2的文件上传

    使用koa2搭建文件上传服务,后端代码 const os = require('os'); const path = require('path'); const koaBody = require( ...

  7. itemscope itemtype="http://schema.org/AggregateRating"

    Review Canonical URL: http://schema.org/Review Thing > CreativeWork > Review A review of an it ...

  8. 20165321 学习基础与C语言学习心得

    一.技能学习 我其实在小时候学过挺多东西,在我小学的时候,我曾经短时间地学过小提琴.拉丁舞.国画.书法,但是,由于各种原因,都没有继续学习下去.后来,在我小学四年级的时候,我接触到了二胡,于是,我开始 ...

  9. MongoDB--连接客户端和服务

    直接在官网上下载好编译好的二进制文件,安装.这里安装在c盘了 安装图形界面: 打开文件进入C:\Program Files\MongoDB\Server\3.4\bin 在bin目录下: 客服端和服务 ...

  10. 判断一个url是否是图片

    public bool RemoteFileExists(string fileUrl) { bool result = false;//下载结果 WebResponse response = nul ...