装oracle时,老是要先装一些包,在装的时候会出现包依赖的关系,如何解决依赖包关系,用本地yum
1、挂载本地光盘
mkdir /media/cdrom
[root@asmtest cdrom]# mount /dev/cdrom /media/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
2、修改cat /etc/yum.repos.d/rhel-debuginfo.repo(修改之前先备份一下)
cp rhel-debuginfo.repo rhel-debuginfo.repo.bak
[root@asmtest ~]# cat /etc/yum.repos.d/rhel-debuginfo.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
修改红色字体部分(修改为刚mount的目录下)
baseurl=file:///media/cdrom/Server
enabled=1
3、执行以下命令
执行yum clean all
[root@asmtest Server]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
执行 yum list ,看到如下界面就成功了
[root@asmtest Server]# yum list
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
rhel-debuginfo | 1.3 kB 00:00
rhel-debuginfo/primary | 868 kB 00:00
rhel-debuginfo: [#################### ] 791/3116
最后安装你想要的lib,如果有依赖包,会自动安装依赖包
yum -y install unixODBC-devel-2.2.11-7.1.i386.rpm