Yum安装iso光盘中的软件配置

Yum安装iso光盘中的软件配置

其实就是修改/etc/yum.repos.d/rhel-debuginfo.repo文件中baseurl的值。

[root@localhost ~]# mount  -----查看iso镜像在那个设备文件上

/dev/sda2 on / type ext3 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

/dev/sda5 on /home type ext3 (rw)

/dev/sda1 on /boot type ext3 (rw)

tmpfs on /dev/shm type tmpfs (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

.host:/ on /mnt/hgfs type vmhgfs (rw,ttl=1)

none on /proc/fs/vmblock/mountPoint type vmblock (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

/dev/hdc on /media/RHEL_5.4 i386 DVD type iso9660 (ro,noexec,nosuid,nodev,uid=0)

接下来就是把redhat 镜像iso挂载到/repo/iso目录下

[root@localhost ~]mkdir  /repo/iso

[root@localhost ~]#mount -t iso9660 -o loop /dev/hdc   /repo/iso/

在配置yum脚本

[root@localhost dg]# cd /etc/yum.repos.d/

把原先的备份一份

[root@localhost yum.repos.d]# cp rhel-debuginfo.repo rhel-debuginfo.repo.bak

[root@localhost yum.repos.d]# ls

rhel-debuginfo.repo  rhel-debuginfo.repo.bak

[root@localhost yum.repos.d]#gedit rhel-debuginfo.repo

把里面的内容改为如面

[rhel-debuginfo]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug

baseurl=file:///repo/iso/Server

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

保存退出

安装gcc软件

[root@localhost ~]# yum install gcc

猜你喜欢

转载自yuanyuan7891.iteye.com/blog/2285945
今日推荐