1. 程式人生 > >RHEL7(RedHat 7)本地yum源的配置

RHEL7(RedHat 7)本地yum源的配置

創建文件 測試 配置 檢查 .cn 本地yum源 mon 識別 保存

配置yum 源

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 #啟用yum源,0為不啟用,1為啟用

gpgcheck=0 #檢查GPG-KEY,0為不檢查,1為檢查

:wq! #保存退出

技術分享圖片

4、、測試使用yum命令自動安裝軟件

yum clean all #清除yum緩存

yum makecache #緩存本地yum源中的軟件包信息

yum repolist all

yum -y install mlocate

rpm -q mlocate

rpm -ql mlocate #查詢所有安裝httpd的目錄和文件

RHEL7(RedHat 7)本地yum源的配置