redhat5.4/5设置本地光盘为yum源安装

时间:2022-07-20 07:09:30

 1.新建目录

       #mkdir -p /mnt/cdrom

       #mount /dev/cdrom /mnt/cdrom

   2.修改yum配置文件

   #vi /etc/yum.repos.d/rhel-debuginfo.repo

   清除所有内容,添加如下内容:

   [rhel-debuginfo]

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

baseurl=file:///mnt/cdrom/Server

enabled=1

gpgcheck=1

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

[Cluster]

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

baseurl= file:///mnt/cdrom/Cluster

enabled=1

gpgcheck=1

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

[ClusterStorage]

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

baseurl= file:///mnt/cdrom/ClusterStorage

enabled=1

gpgcheck=1

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

[Server]

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

baseurl= file:///mnt/cdrom/Server

enabled=1

gpgcheck=1

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

[VT]

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

baseurl= file:///mnt/cdrom/VT

enabled=1

gpgcheck=1

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

 


保存,退出。

3.更新 yum配置

#yum clean all