由于自动虚拟机安装CentOS,发现gdb没有安装,查找了一些资料,实践了一下通过yum来执行iso包来安装gdb,步骤如下:
- 通过VM直接设置光盘文件位置
- 备份修改repo文件
[root@localhost wm]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum.repos.d]# more CentOS-Media.repo
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# ls
bak CentOS-Debuginfo.repo CentOS-Vault.repo
CentOS-Base.repo CentOS-Media.repo
[root@localhost yum.repos.d]# mv *.repo /etc/yum.re