CentOS using the ISO file create local source yum

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

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.

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.

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

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.

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.

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.

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

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

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

 

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

Guess you like

Origin www.linuxidc.com/Linux/2019-08/160412.htm