yumのリポジトリをDVD-ROMにしてみた
最新版のCentOS 5.8ではなく、CentOS 5.5で検証したい、でもモジュールの依存関係を自己解決するの面倒、というときに。
下記のように、/media/CentOS, /media/cdrom/, /media/cdrecorder/がリポジトリに設定されているが、無効(enabled=0)になっている。
# cat /etc/yum.repos.d/CentOS-Media.repo # CentOS-Media.repo # # This repo is used to mount the default locations for a CDROM / DVD on # CentOS-5. You can use this repo and yum to install items directly off the # DVD ISO that we release. # # To use this repo, put in your DVD and use it with the other repos too: # yum --enablerepo=c5-media [command] # # or for ONLY the media repo, do this: # # yum --disablerepo=\* --enablerepo=c5-media [command] [c5-media] name=CentOS-$releasever - Media baseurl=file:///media/CentOS/ file:///media/cdrom/ file:///media/cdrecorder/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
インターネットから取得するのをやめて、DVD-ROMからインストールするために/etc/yum.repos.d/以下のファイルを直接編集してもいいし、yumコマンドの--disablerepo, --enablerepoで指定してもいい。下記は、vnc-serverをインストールしてみた例。
# mount -t iso9660 -r /dev/cdrom /media/cdrom # yum --disablerepo=\* --enablerepo=c5-media install vnc-server
うまくいったので終了。