step first: mount rdhat.iso to local disk
for example : mount -o loop ../rhat.iso /media/redhat
step second: modi file
file : /etc/yum.repos.d/rhel-source.repo
vi /etc/yum.repos.d/rhel-source.repo
--------------------------------------------------------------------------------
baseurl= file:///media/redhat ---- only change this
file:///media/redhat directory has mount redhat-iso disk
-----------------------------------------------------------------------------------
step third: check file
view rhel-source.repo file (after modi) :
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
baseurl= file:///media/redhat
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum --disablerepo =* --enablerepo= rhel-source install glibc.i686
step fifth: some command
1 //check update of rpm package
#yum check-update
2 //Update all rpm package
#yum update
???s
#yum upgrade
4 list package info in repos
# yum list
5 list installed package
# yum list installed
6 list can update package
# yum list updates
7 install package
# yum install pack_name
8 uninstall package
# yum remove pack_name
yum暂存(/var/cache/yum/)的相关参数
1 //清除暂存中rpm包文件
#yum clean packages
2 //清除暂存中rpm头文件
#yum clearn headers
3 //清除暂存中旧的rpm头文件
#yum clean oldheaders
4 //清除暂存中旧的rpm头文件和包文件
#yum clearn 或#yum clearn all