本地yum源配置
阿新 • • 發佈:2018-12-27
RHEL7 配置本地yum 源
1
、
掛載DVD光碟到/mnt 因為配置時候路徑名裡面不能有空格,否則不能識別
[[email protected] mnt]# mount /dev/cdrom /mnt #提示只讀檔案系統無視 2、在目錄/etc/yum.repos.d/ mkdir /etc/yum.reposd/.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快取 yummakecache # 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防火牆。 |