1、将ISO镜像插入虚拟机或者光驱
2、创建一个yum.repo文件
[root@node1 ~]# cd /etc/yum.repos.d/ [root@node1 yum.repos.d]# ls rhel-debuginfo.repo [root@node1 yum.repos.d]# cp rhel-debuginfo.repo yum.repo
3、编辑yum.repo文件
编辑之前
[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [rhel-debuginfo-beta] name=Red Hat Enterprise Linux $releasever Beta - $basearch - Debug baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/$basearch/Debuginfo/ 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
编辑之后
[base] name=Red Hat Enterprise Linux baseurl=file:///media/Server enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
4、挂载光盘
[root@node1 yum.repos.d]# mount /dev/cdrom /media/ mount: block device /dev/cdrom is write-protected, mounting read-only [root@node1 yum.repos.d]#
5、通过yum进行安装软件包
[root@oggsource ~]# yum install strace Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package strace.i386 0:4.5.18-5.el5_4.1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================== Installing: strace i386 4.5.18-5.el5_4.1 base 171 k Transaction Summary ============================================================================================================================================== Install 1 Package(s) Upgrade 0 Package(s) Total download size: 171 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : strace 1/1 Installed: strace.i386 0:4.5.18-5.el5_4.1 Complete! [root@oggsource ~]#
6、操作完成
原文:http://www.cnblogs.com/arcer/p/3546353.html