Shirou20000

1、挂载DVD光盘到/mnt   因为配置时候路径名里面不能有空格,否则不能识别  [root@ mnt]# mount /dev/cdrom /mnt  

2、在目录/etc/yum.repos.d/创建文件文件名.repo 

3、配置本地yum源

cd /etc/yum.repos.d/   #进入yum配置目录 

touch  rhel7.repo   #建立yum配置文件 

vim  rhel7.repo   #编辑配置文件,添加以下内容 

[rhel-yum]
 
name=rhel7
 
baseurl=file:///mnt
 
enabled=1
 
gpgcheck=0

4、测试使用yum命令自动安装软件

yum clean all   #清除yum缓存 

yum makecache  #缓存本地yum源中的软件包信息

5、安装软件

例如安装mlocate

yum -y install mlocate

6、查询

例如查询所有安装httpd的目录和文件

rpm -ql mlocate  

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-04-05
  • 2021-12-27
  • 2021-09-10
  • 2021-08-19
  • 2021-08-14
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2021-12-14
  • 2021-07-23
  • 2021-05-18
  • 2021-10-31
  • 2021-06-13
  • 2021-11-20
相关资源
相似解决方案