RedHat5 sets up yum source server (FTP) 1. Start redhat5 and put the CD in, mount it to/media/cdrommkdir/media/cdrommount/dev/cdrom/media/cdrom2 and install the FTP service (skip this step if the local machine is used) cd/media/cdrom/Serverrpm-ivhvsftpd * chkconfigvsftpd
RedHat5 yum source server (FTP)
1. Start redhat5, put the disc in, and mount it to/media/cdrom.
Mkdir/media/cdrom
Mount/dev/cdrom/media/cdrom
2. Install the FTP service (skip this step if the local machine is used)
Cd/media/cdrom/Server
Rpm-ivh vsftpd *
Chkconfig vsftpd on
Service vsftpd start
3. Install the createrepo Software Package
Rpm-ivh createrepo *
4. copy the files in the system disk to the local machine.
Cp-R/media/cdrom/Server/var/ftp/pub
5. Generate the yum Source
(1) generating dependency
Createrepo-g/var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml/var/ftp/pub/Server
If the prompt "cocould not remove old metadata dir:. olddata" says there is a directory problem and you don't have to worry about it. Just delete the directory.
Rm-rf/var/ftp/pub/Server/. olddata
Then, repeat the operation.
(2) create a repository file
Vim/etc/yum. repos. d/yum. repo
[Yum-ftp]
Name = base
Baseurl = ftp: // ip/pub/Server
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
You can directly use yum to install rpm next time.