系统相关
首页 > 系统相关> > linux- 挂载本地iso,配置本地yum

linux- 挂载本地iso,配置本地yum

作者:互联网

 

------------------------------------

关于centos8安装vm-tools:

workstation部署centos8之后,不需要单独安装vm-tools,系统已自动安装:

验证:

[root@centos8 iso]# rpm -qa | grep vm-tools
open-vm-tools-10.3.10-3.el8.x86_64
open-vm-tools-desktop-10.3.10-3.el8.x86_64
[root@centos8 iso]#

  

----------------------------------------------

挂载本地iso,

方案一:

workstation挂载iso

 

查看挂载目录:

[root@centos8 ~]# df -h
Filesystem                   Size  Used Avail Use% Mounted on
……
/dev/sr0                     7.1G  7.1G     0 100% /run/media/root/CentOS-8-1-1911-x86_64-dvd
[root@centos8 ~]#

  

方案二:

直接挂载iso文件,

挂载iso文件需要添加参数 “-o loop”

# mount centos.iso -o loop /iso

  

-----------------------

配置本地yum

[root@centos8 ~]# df -h
Filesystem                   Size  Used Avail Use% Mounted on
……
/dev/sr0                     7.1G  7.1G     0 100% /run/media/root/CentOS-8-1-1911-x86_64-dvd
[root@centos8 ~]#
[root@centos8 ~]# cd /etc/yum.repos.d/
[root@centos8 yum.repos.d]# mkdir bak
[root@centos8 yum.repos.d]# mv Centos* bak
[root@centos8 yum.repos.d]# vi CentOS-Base.repo
[root@centos8 yum.repos.d]# cat CentOS-Base.repo
[CentOS-Base]
name=CentOS-server
baseurl=file:///run/media/root/CentOS-8-1-1911-x86_64-dvd/AppStream
enabled=1
gpgcheck=0
[root@centos8 yum.repos.d]#

[root@centos8 yum.repos.d]# yum makecache
CentOS-server                                                                            89 MB/s | 5.4 MB     00:00
Last metadata expiration check: 0:00:01 ago on Sat 06 Aug 2022 04:45:20 PM CST.
Metadata cache created.
[root@centos8 yum.repos.d]#

  备注:

[CentOS-Base]								//yum的ID,本地唯一,用于区分不同yum源
name=CentOS-server							//描述信息
baseurl=file:///run/media/root/CentOS-8-1-1911-x86_64-dvd/AppStream	//前面的file://是协议,后面的/run……是光盘挂载点
enabled=1								//1启用yum源,0禁用yum源
gpgcheck=0								//1使用公钥验证rpm包的正确性,0不验证

  

 

标签:CentOS,repos,yum,本地,iso,root,centos8
来源: https://www.cnblogs.com/lei2017/p/16557438.html