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. 谷歌浏览器安装octotree插件

    Octotree Chrome安装与使用方法 Octotree Chrome作用: 主要使你在github查看项目时可以清晰明了的看到项目的结构以及具体代码,使下载代码更具有目的性,减少不必要代码的下 ...

  2. Linux发展历程

    阅读内容 一.linux基础 二.linux发展史 三.linux图形界面 回到顶部 一.linux基础 1.操作系统的分类 1.1 Windows 系统 优点:Windows 用户群体大:应用软件多 ...

  3. 永久有效的 webstorm license server 20180808

    下载地址  https://download.jetbrains.com/webstorm/WebStorm-2018.3.2.exe 2018年10月26日,最近老是过期,搞了一个1年有效的代码,是 ...

  4. jvm - 类的初始化过程

    我们知道,我们写的java代码称为源码,想要能够被jvm执行首先需要编译成.class文件,那么编译完到使用又都经理的哪些阶段呢?主要分为以下三个阶段: 加载:查找并加载类的二进制数据(.class文 ...

  5. [js] Array.slice和类数组转数组

    a.call(b) 相当于把a方法放到b的原型上(实例私有方法)执行 Array.slice的用途 https://juejin.im/post/5b20b8596fb9a01e8d6a47c0 用法 ...

  6. [LeetCode] 455. Assign Cookies_Easy tag: Sort

    Assume you are an awesome parent and want to give your children some cookies. But, you should give e ...

  7. 如何使用Hive&R从Hadoop集群中提取数据进行分析

    一个简单的例子! 环境:CentOS6.5 Hadoop集群.Hive.R.RHive,具体安装及调试方法见博客内文档. 1.分析题目 --有一个用户数据样本(表名huserinfo)10万数据左右: ...

  8. python导入csv/txt文件

    1. 导入csv文件 ### python导入csv文件的三种方法 ```python #原始的方式 lines = [line.split(',') for line in open('iris.c ...

  9. iOS UI布局-VFL语言

    什么是VFL语言 VFL(Visual Format Language),“可视化格式语言”. VFL是苹果公司为了简化autolayout的编码而推出的抽象语言. 语法说明 H:[cancelBut ...

  10. Spring.之.jar包官网下载

    jar包官网下载 1. 官网下载网址:http://repo.spring.io/libs-release 2. 用到的jar包所在路径:org/springframework/spring/ ,在此 ...