本文配置本地yum源是把redhat 7的系統盤內容復制到服務器硬盤的目錄/RH7ISO中,然後配置yum指向該目錄。首先掛載光驅到/mnt目錄 :
mount /dev/cdrom /mnt

復制系統盤的內容到/RH7ISO目錄中:
cp -R /mnt/* RH7ISO
進入yum配置目錄 :
cd /etc/yum.repos.d/ 建立yum配置文件:
touch rh7ISO.repo 編輯配置文件,添加以下內容:
vi rh7ISO.repo 
清除yum緩存:
yum clean all 緩存本地yum源中的軟件包信息:
yum makecache 
配置完畢!可以直接使用yum install packname進行yum安裝了!
本文出自 “江健龍的技術博客” 博客,請務必保留此出處http://jiangjianlong.blog.51cto.com/3735273/1787675