码迷,mamicode.com
首页 > 系统相关 > 详细

linux yum配置本地iso镜像

时间:2018-05-06 16:13:00      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:成功   users   sed   linu   自己   lov   url   nod   software   

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=1

gpgcheck=0

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=1
gpgckeck=0
gpgkey=file:///mnt/iso/RPM-GPG-KEY-redhat-release

5.清除cache

yum clean all

6.验证是否成功

yum -y install tree

tree

3、网络源配置

# cat /etc/yum.repos.d/cent6-epel.repo 
[base]
name=CentOS-6 - 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=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6 - 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=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6 - 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=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - 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=1
enabled=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - 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=1
enabled=0
gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

[epel]
name=Extra Packages for Enterprise Linux 6 - 
baseurl=http://mirrors.ustc.edu.cn/epel/6/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 -  - 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=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
 
[epel-source]
name=Extra Packages for Enterprise Linux 6 -  - Source
baseurl=http://mirrors.ustc.edu.cn/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1    
测试是否正常运行
yum list 

 

linux yum配置本地iso镜像

标签:成功   users   sed   linu   自己   lov   url   nod   software   

原文地址:https://www.cnblogs.com/tiandi/p/8998315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!