Use the installation CD to create a local Yum Repository

Source: Internet
Author: User

To avoid problems such as incomplete software packages, slow downloading speeds, and network faults that may occur when downloading software packages from the network, we strongly recommend that you use a local DVD/cd iso to create a yum repository, in this way, the installation speed is fast, and all software packages can be installed smoothly.

1. Put the CD in the optical drive and install the required packages. (If the packages below are already installed, skip this step. After installing the SSH service, you can use putty and other software for remote operations .) :

[Root @ mjwdj ~] # Mkdir /Mnt/ISO/ [Root @ mjwdj ~] # Mount /Dev/HDC/mnt/ISO/ [Root @ mjwdj ~] # Rpm-I -- nodeps/mnt/ISO/Server/fipscheck-Lib- 1.2 . 0 - 1  . El5.i386. RPM [root @ mw.dj ~] # Rpm-I -- nodeps/mnt/ISO/Server/fipscheck-1.2 . 0 - 1  . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/openssh- 4 . 3p2- 72  . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/TCP_WRAPPERS- 7.6 - 40.7  . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/openssh-server- 4 . 3p2- 72 . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/openssh-client- 4 . 3p2- 72  . El5.i386. RPM [root @ mw.dj ~ ] # Service sshd start [root @ mw.dj ~ ] # Chkconfig sshd on [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/rpm-Python- 4.4 . 2.3 - 22  . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Yum-metadata-parser- 1.1 .2 - 3  . El5.i386. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/createrepo- 0.4 . 11 - 3  . El5.noarch. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Python-elementtree- 1.2 . 6 - 5  . I386.rpm [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Python-iniparse- 0.2 .3 - 4  . El5.noarch. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/m2crypto- 0.16 - 6 . El5. 8  . I386.rpm [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Python-urlgrabber- 3.1 . 0 - 6  . El5.noarch. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Python-SQLite- 1.1 .7 - 1.2 . 1  . I386.rpm [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Yum- 3.2 . 22 - 33  . El5.noarch. RPM [root @ mw.dj ~] # Rpm-IVH/mnt/ISO/Server/Yum-utils- 1.1 . 16 - 13 . El5_4. 1 . Noarch. rpm

 

A. If you are using an official DVD iso or multiple cd iso files, copy them to the system, mount them, and create a yum Repository:

[Root @ mjwdj ~] # Mkdir /Mnt/ ISO [root @ mjwdj ~] # Mount -O loop/home/centos- 5.8 -I386-bin-DVD.iso/mnt/ISO/ [Root @ mjwdj ~] # Cd/ MNT [root @ mjwdj MNT] # createrepo. [root @ mjwdj ~] # Mkdir -P/mnt /{ 1 , 2 , 3 ,4 , 5 , 6  } [Root @ mjwdj ~] # Mount -O loop/home/centos5. 8 -Disc1.iso/mnt/ 1  [Root @ mjwdj ~] # Mount -O loop/home/centos5. 8 -Disc2.iso/mnt/ 2  [Root @ mjwdj ~] # Mount -O loop/home/centos5.8 -Disc3.iso/mnt/ 3  [Root @ mjwdj ~] # Mount -O loop/home/centos5. 8 -Disc4.iso/mnt/ 4  [Root @ mjwdj ~] # Mount -O loop/home/centos5. 8 -Disc5.iso/mnt/ 5  [Root @ mjwdj ~] # Cd/mnt/ [Root @ mw.dj MNT] # createrepo. 

 

B. If you need to attach a CD, create a yum repository.

 
[Root @ mjwdj ~] #Mount/Dev/HDC/Media/ISO/[Root @ mjwdj~] # Cd/mnt/[Root @ mw.dj MNT] # createrepo.

 

Clear and redefine the yum Repository:

 
[Root @ mjwdj ~] #Rm-F/etc/yum. Repos. d/*[Root @ mjwdj ~] # Echo "[dvdiso]">/etc/yum. Repos. d/dvdiso. Repo [root @ mjwdj ~] # Echo "name = dvd iso">/etc/yum. Repos. d/dvdiso. Repo [root @ mjwdj ~] # Echo "baseurl = file: // MNT/">/etc/yum. Repos. d/dvdiso. Repo [root @ mjwdj ~] # Echo "enabled = 1">/etc/yum. Repos. d/dvdiso. Repo [root @ mjwdj ~] # Echo "gpgcheck = 0">/etc/yum. Repos. d/dvdiso. Repo [root @ mjwdj ~] # Yum clean all [root @ mw.dj ~] # Yum list

 

If you can see the name of the software package in the repository you just created in the output of the 'yum list' command, it is OK. Try to install a software package to check whether it is successful:

 
[Root @ mjwdj ~] # YumInstallMysql-Server

 

Original address: http://blog.chinaunix.net/space.php? Uid = 20346344 & Do = Blog & id = 3264166

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.