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. gitlab访问用户安装的postgresql数据库

    1.先将gitlab默认安装的postgresql的数据库中的数据,导入到用户安装的postgresql数据 用Navicat迁移数据.函数不用迁移. 2.配置gitlab对postgresql数据库 ...

  2. Python之路 day1 基础1 变量 for while 用户输入

    一. Python介绍 python的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,吉多·范罗苏姆为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为AB ...

  3. 004-RestTemplate 使用常见问题

    一.使用 同前三节:ClientGetGoodsByGoodsIdResponse response = restTemplate.postForObject(svcUrl, request, Res ...

  4. Java Script注意事项

    1.HTML中,打错标点符号 或输入格式不对(多输等号 或少加括号等) 会导致字体颜色不对劲 2.写Java Script时通常的做法是把函数放入 <head> 部分中,或者放在页面底部. ...

  5. 比Xshel更好用的 FinalShell

    FinalShell功能特点: 1.多平台支持Windows,Mac OS X,Linux 2.多标签,批量服务器管理. 3.支持登录Ssh和Windows远程桌面. 4.漂亮的平滑字体显示,内置10 ...

  6. php 代码复用机制

    https://juejin.im/entry/5927ec4544d904006413f61d 提到 php 的代码复用,我们可能第一时间会想到继承,但是这种单继承语言一旦派生的子类过多,那么会产生 ...

  7. python线程中的join(转)

    Python多线程与多进程中join()方法的效果是相同的. 下面仅以多线程为例: 首先需要明确几个概念: 知识点一:当一个进程启动之后,会默认产生一个主线程,因为线程是程序执行流的最小单元,当设置多 ...

  8. python-类属性和对象属性(转)

    class People(object): # 类属性是指定义在类的内部而且在方法的外部的属性 money = 10000 def __init__(self,name,age,gender=1): ...

  9. Jmeter知识点

    聚合报告说明 https://www.cnblogs.com/duanxz/p/5464993.html JMeter之Ramp-up Period(in seconds)说明(可同时并发) http ...

  10. Goland的使用

    一.安装Goland 一.Goland简介 Goland是由JetBrains公司旨在为go开发者提供的一个符合人体工程学的新的商业IDE.这个IDE整合了IntelliJ平台的有关go语言的编码辅助 ...