Linux安装oracle需要很多的软件包,使用rpm –ivh 包名 的命令一个个安装会很烦,而且很多包需要依赖于别的包,你又要先安装别的包,简直吐血。使用YUM就可以很自动的安装一些依赖关系的包。本章详细介绍了如何配置本地yum源,在配置的过程你不知不觉就会学习到一些linux的知识
1、挂载本地光盘到系统
把rhel6.5安装光盘放入光驱
注:设备状态已连接和启动时连接要勾上。不然linux虚拟机挂载光盘时报错mount: you must specify the filesystem type
下面开始可以牛逼的使用本机的SecureCRT工具;
新建挂载目录
挂载光盘到/media/rhel目录下
进入挂载目录,可以ls查看光盘的内容。
2、配置本地yum源
[root@localhost /]# cd /etc/yum.repos.d/
#进入yum配置目录。下面不截图了,直接文字
[root@localhost yum.repos.d]# virhel-source.repo
#可以看到下面的内容,看起来很复杂,其实不用怕,主要是加粗的地方改下路径,删掉备用的就OK
[rhel-source]
name=Red Hat Enterprise Linux $releasever -$basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releaseverBeta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
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
---------编辑配置文件,按键i,替换成以下内容,按ESC键,:wq!
[rhel-source]
name=Red Hat Enterprise Linux 6.5
baseurl=file:///media/rhel
enabled=1
gpgcheck=1
gpgkey=file:///media/rhel/RPM-GPG-KEY-redhat-release
[root@localhost yum.repos.d]# virhel-source.repo
---------再查看一下,:q!退出
3、清除yum缓存,使用yum install自动安装软件
尝试安装php
它会问你OK不,你就y吧。一路y下去。
这样就是安装好了,有没有看到complete! ???
[root@localhost rhel]# rpm -qa |grep php
php-common-5.3.3-26.el6.x86_64
php-5.3.3-26.el6.x86_64
php-cli-5.3.3-26.el6.x86_64
------查看安装了PHP没有。有显示就是有。
以上就是本地YUM配置。很方便。