Three kinds of ways to build a warehouse source yum

 

Three kinds of ways to build yum source

First, the  local yum repository set up

1.1, obtain resources software package

The iso image mount a local directory, the mount directory is / var / www / html / repo /, this directory does not exist in itself, it needs to be created. Noble Resources can also get software from the network stations open source image

Mount command:

1 mkdir / var / www / html / repo 
two mount / iso / CentOS7- 1804.iso / var / www / html / repo / 

To see if Mount success.

View command:

1 df -h # View information mounted device
 2 ll / var / www / html / repo to see if there is content # mount directory.

1.2, the client modify the configuration file

Adding edit the configuration file in the default configuration file directory. The profile for added repo_local.repo.

command:

1 [root@room9pc01 iso]# cd /etc/yum.repos.d/
2 [root@room9pc01 yum.repos.d]# touch repo_local.repo

 

Edit the configuration file repo_local. Enter at the contents. Save and exit.

. 1 [repo_local] #yum repository name, customizable
 2 = the repo name for local #yum description information repository . 3 BaseURL = File: /// var / WWW / HTML / the repo / access address #yum source. file: // + local source directory is yum yum local fixed-format source access addresses. = Enabled. 4 . 1 # Enable warehouse . 5 gpgcheck = 0 # Red Hat tag check is not performed

 

1.3 Inspection yum source warehouse to build success.

command:

1 Is there a package yum yum repolist # View source

The previous commands, it can be seen repo_local warehouse 9911 package, source local yum repository to build success.

Second, the network yum source structures

2.1 , via http to build yum access address of the source.

Install httpd software. Start httpd service and setting to boot. The domain name not access the yum source address.

command:

1 yum –y install httpd
2 systemctl restart httpd 3 systemctl enabled httpd

Check whether the installation is successful httpd, httpd service is started.

Yum package to obtain resources.

Iso image will be mounted at the root of the service httpd web page file, the mount directory is / var / www / html / repo /, this directory does not exist in itself, needs to be created.

Mount command:

1 mkdir / var / www / html / repo
 two mount / iso / CentOS7- 1804.iso / var / www / html / repo /

To see if Mount success.

View command:

1 df -h # View information mounted device
 2 ll / var / www / html / repo to see if there is content # mount directory.

 2.2, the client modify the configuration file

Adding edit the configuration file in the default configuration file directory. The profile for added repo_http.repo.

command:

1 [root@room9pc01 iso]# cd /etc/yum.repos.d/
2 [root@room9pc01 yum.repos.d]# touch repo_http.repo

 Edit the configuration file repo_http.repo. Enter at the contents. Save and exit.

. 1 [repo_http] #yum repository name, customizable
 2 = the repo name for HTTP #yum description information repository . 3 BaseURL = HTTP: // network access address 176.130.2.72/repo/ #yum source. = Enabled. 4 . 1 # Enable warehouse . 5 gpgcheck = 0 # Red Hat tag check is not performed

 2.3 Inspection yum source warehouse to build success

command:

1 Is there a package yum yum repolist # View source

  

Through the above commands, it can be seen repo_http 9911 warehouse packages, warehouse source network yum successful structures.

Third, self yum source warehouse

3.1 , download the required packages and placed in the same directory. Creating available yum source file.

The downloaded packages / media / repo1 / in.

 

There are two software packages downloaded.

Yum create source files available.

command:

1 createrepo  /media/repo1/ 

This command can generate a package manifest file. So that the drain current directory software package can be used as access address yum source.

The directory to / var / www / html / in.

command:

1 cp -a / media / repo1 / var / www / html /

 

3.2, the client modify the configuration file

Adding edit the configuration file in the default configuration file directory. The profile for added repo_self.repo.

command:

1 [root@room9pc01 iso]# cd /etc/yum.repos.d/
2 [root@room9pc01 yum.repos.d]# touch repo_self.repo

 

Edit the configuration file repo_self.repo. Enter at the contents. Save and exit.

. 1 [repo_self] #yum repository name, customizable
 2 = the repo name for Self #yum description information repository . 3 BaseURL = HTTP: // 176.130.2.72/repo1/ #yum source access address. = Enabled. 4 . 1 # Enable warehouse . 5 gpgcheck = 0 # Red Hat tag check is not performed

3.3 Inspection yum source warehouse to build success.

command:

1 Is there a package yum yum repolist # View source

 

Through the above commands, it can be seen repo_self two warehouse packages, warehouse source network yum successful structures.

Guess you like

Origin www.cnblogs.com/wwtao/p/11872126.html