最近安装ORACLE 11gR2,被包依赖搞的头昏脑胀,结果研究发现yum对付包依赖比较方便,如果能连接互联网可以直接解决包依赖的问题,但是无网络就比较麻烦,只能自己建立本地yum源,结果自己在建立yum源的时候发现redhat 光盘中已经建立了yum源,可以直接用,方法如下:
1、挂载ISO光盘文件:
mount -t iso9660 -o loop /tmp/rhel6.1.iso /mnt/cdrom
2、修改yum配置文件:
vi /etc/yum.repos.d/rhel-source.repo
[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:///mnt/cdrom/Server/
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/
baseurl=file:///mnt/cdrom/Server/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
就是将
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/ 改为
baseurl=file:///mnt/cdrom/Server/
指向安装光盘中的yum源所在的位置
修改后再用yum安装所需的包,yum会自动查找依赖包,并自动安装了。如:
yum -v install compat-libstdc++-33-3.2.3-69.el6.i686.rpm