CentOS yum making use of local image file source

   Yum (called the Yellow dog Updater, Modified) is a well in Fedora and RedHat CentOS of Shell distal package manager. Based on RPM package management, can automatically download from the specified server RPM package and installed, you can automatically handle dependencies, and install all packages depending on, again and again without the cumbersome download and installation. In the case of Linux can not be connected to the wide area network, we could not connect to the server using the yum yum services. If you can not use yum, then we install Linux packages will become very troublesome, will depend on the situation of various software packages.

          Starting the following, first to add a mirror installed in CentOS CentOS virtual machines.

image.png

        After the addition is complete we need to hang a mirror in the optical disk device. Use mount / dev / sr0 / mnt / CD-ROM image file linked to the mnt directory below, so we can use the image file in.

image.png

     Next, use the cd / mnt / mnt into the directory with the command ls we have seen the image file to disc. Our RPM packages inside a file called Packages that we go take a look.

image.png

     Inside the package we've seen a lot of rpm, we mainly want this rpm package yum pool as one of our sources.

image.png

     I want to enter cd /etc/yum.repos.d/ this directory, the directory is to put some of the main yum configuration file. We need the original configuration of the system to back up what the crisis, to write a configuration file.

image.png

     First we need to create a folder, use mv CentOS * ./abk yum command to the original system configuration files are placed in the newly created folder abk them to go.


     image.png

     Next, create a new tool with vim configuration file, the name is not required, the suffix must be a repo, or can not take effect.

image.png3

   The following is written is a fixed format baseurl base address points to the directory hanging mirror, gpgcheck a secret key feature here is not a secret key to enable this function, enabled means is activated if the number is 1, then opening the representative

If it is 0, then the representative of shut down, and then we save it.

[123]

name=test

baseurl = file: /// mnt

gpgcheck=0

enabled=1



image.png

     Save the file after we use yum clean all command to clear it cache data.

image.png


     Next, use yum list command to see what it can update packages.


  

image.png

    Here has been successful with a pool of local software image file instead of yum source server outside the network.

image.png

       




Guess you like

Origin blog.51cto.com/14451009/2429563