歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> RHEL7 本地yum源配置

RHEL7 本地yum源配置

日期:2017/2/28 13:45:08   编辑:Linux教程

RHEL7 配置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 install httpd #安裝apache

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

systemctl start httpd.service #啟動apache

systemctl stop httpd.service #停止apache

systemctl restart httpd.service #重啟apache

systemctl enable httpd.service #設置開機啟動

RHEL 7.0默認使用的是firewall作為防火牆,這裡改為iptables防火牆。

5、通過yum安裝GUI圖形界面# yum -y groupinstall "Server with GUI"可以執行startx看下效果。

通過yum卸載軟件 yum -y remove httpd(移除httpd軟件)

Copyright © Linux教程網 All Rights Reserved