1.首先挂载光盘,我把光盘挂载到/media/cd下。
在/media 下新建文件夹 /rhel :mkdir /media/cd
然后挂载5.4的dvd安装盘: mount /dev/cdrom /media/cd
2.确保系统中已经安装了如下软件包(您的版本号可能有所不同),如果缺少,请自行安装(这些包在安装红帽子的时候基本都默认安装了。)
# rpm -qa |grep yum
yum-3.2.19-18.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5
yum-rhn-plugin-0.5.3-30.el5
yum-metadata-parser-1.1.2-2.el5
# rpm -qa |grep yum
yum-3.2.19-18.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5
yum-rhn-plugin-0.5.3-30.el5
yum-metadata-parser-1.1.2-2.el5
3.编辑/etc/yum.repos.d/rhel-debuginfo.repo,添加如下内容
baseurl=file:///media/cd/Server
enabled=1
enabled=1
4.执行yum update命令
[root@node1 yum]# yum update
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 | 732 kB 00:00
rhel-debuginfo 2292/2292
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
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 | 732 kB 00:00
rhel-debuginfo 2292/2292
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
5.至此就可以使用yum安装rpm包了
例如:yum install fonts-chinese -y
本文介绍了如何在Red Hat系统中配置YUM源,通过挂载安装盘并编辑配置文件来实现本地YUM源的设置,进而可以方便地进行软件包的更新与安装。

731

被折叠的 条评论
为什么被折叠?



