redhat5.5
1. Mount the optical drive
[[Email protected] ~] #mkdir-P/mnt/cdrom
[[Email protected] ~] #mount-T Iso9660/dev/cdrom-sr0/mnt/cdrom
2. Copy the Redhat CD contents to the local hard drive
Because the directory where the Yum source is created, it must be a directory that can be written to, so all the files on the disc need to be copied to the local directory, and if the/mnt/cdrom CD-ROM mount directory is executed to create the Yum source, it will be reported "Directory/mnt/cdrom must be writable." Error
[[Email protected] ~] #mkdir-P/mnt/redhat
[Email protected] ~]# \cp-r/mnt/cdrom//mnt/redhat/
[Email protected] ~]# Cd/mnt/redhat
3. Install Createrepo Package
[Email protected] server]# cd/mnt/redhat/server/
[Email protected] server]# ls-l |grep Createrepo
-r--r--r--1 root root 60901 Apr createrepo-0.4.11-3.el5.noarch.rpm
[Email protected] server]# RPM-IVH createrepo-0.4.11-3.el5.noarch.rpm
4. Create the Server.repo file in the/ETC/YUM.REPOS.D directory
[Email protected] server]# cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# pwd
/etc/yum.repos.d
[Email protected] yum.repos.d]# VI Server.repo
[Server]
Name=server
Baseurl=file:///mnt/redhat/server
Enabled=1
Gpgcheck=0
[Cluster]
Name=cluster
Baseurl=file:///mnt/redhat/cluster
Enabled=1
Gpgcheck=0
[Clusterstorage]
Name=clusterstorage
Baseurl=file:///mnt/redhat/clusterstorage
Enabled=1
Gpgcheck=0
[VT]
Name=vt
Baseurl=file:///mnt/redhat/vt
Enabled=1
Gpgcheck=0
5. Create a yum library with Createrepo
[Email protected] yum.repos.d]# cd/mnt/redhat/server/
[Email protected] server]# Createrepo/mnt/redhat
3389/3389-clusterstorage/gfs-utils-0.1.20-10.el5.x86_64.rpm pm_64.rpm
Saving Primary Metadata
Saving file lists Metadata
Saving other metadata
This article is from the "cold" blog, so be sure to keep this source http://jiahan.blog.51cto.com/9717419/1725187
Redhat Configuring the local Yum source