美文网首页
centos7基于光驱搭建本地yum源

centos7基于光驱搭建本地yum源

作者: 东南猫 | 来源:发表于2019-11-20 16:52 被阅读0次

1.挂载光驱并拷贝数据到指定目录/yumserver

[root@localhost mnt]# mount -t iso9660 /dev/cdrom /mnt/

mount: /dev/sr0 is write-protected, mounting read-only

[root@localhost mnt]# mkdir -p /yumserver

[root@localhost mnt]# cp -a /mnt/* /yumserver/

2.创建repo文件

[root@localhost yum.repos.d]# cd /etc/yum.repos.d

[root@localhost yum.repos.d]# mkdir -p bak

[root@localhost yum.repos.d]# cp *.repo ./bak

[root@localhost yum.repos.d]# cat cdrom.repo   ##vim 去创建repo文件

[cdrom]

name=CentOS7 - cdrom

baseurl=file:///yumserver/

enable=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

3.验证yum源清单

[root@localhost yum.repos.d]# yum repolist

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

repo id                                                            repo name                                                                    status

cdrom                                                              CentOS7 - cdrom                                                              4,021

repolist: 4,021

[root@localhost yum.repos.d]#

相关文章

网友评论

      本文标题:centos7基于光驱搭建本地yum源

      本文链接:https://www.haomeiwen.com/subject/irnoictx.html