标签:fst roo EOS 虚拟 软件 default def src epo
1、将CentOS-7-x86_64-Everything-1708.iso 文件加载虚拟机光驱2、/mnt 目录创建目录repos,存放之后挂载的光驱文件信息
[root@hmaster mnt]# mkdir repos
[root@hmaster mnt]# ls
repos
[root@hmaster mnt]# pwd
/mnt
3、临时挂载光驱到/mnt/repos/目录,并查看挂载后生成的文件目录信息,Packages包含许多RPM软件安装包
[root@hmaster dev]# mount /dev/cdrom /mnt/repos/
mount: /dev/sr0 is write-protected, mounting read-only
[root@hmaster dev]# cd /mnt/repos/
[root@hmaster repos]# pwd
/mnt/repos
[root@hmaster repos]# ls
CentOS_BuildTag EFI EULA GPL images isolinux LiveOS Packages repodata RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Testing-7 TRANS.TBL
[root@hmaster repos]#
4、配置
[base]
name=CentOS-my
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=file:///mnt/repos/
gpgcheck=0
Enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@hmaster repos]# cd /etc/yum.repos.d/
[root@hmaster yum.repos.d]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo
[root@hmaster yum.repos.d]# vim CentOS-Base.repo
Yum clean all
Yum makecache
Vim /etc/fstab 设置开机自动挂载:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=ace745bb-2d4c-46e0-8be3-0897c52d3b23 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
下载或拷贝CentOS或RedHat的iso镜像到本地,比如 /usr/local/src/CentOS-6.4-x86_64-bin-DVD1.iso
Vim /etc/fstab 设置开机自动挂载:
#挂载iso
/usr/local/src/CentOS-6.4-x86_64-bin-DVD1.iso /mnt/cdrom1 iso9660 loop,defaults 0 0
执行 mount -a 自动检测并激活挂载,若未报错,执行df -h即可看到结果。
标签:fst roo EOS 虚拟 软件 default def src epo
原文地址:http://blog.51cto.com/6000734/2306478