class=”markdown_views prism-atom-one-dark”>
1. Introduction to yum
(1) Introduction to yum
Yum can automatically download and install RPM packages from a specified server, automatically resolve dependencies, and install all dependent software packages at one time, without the need to download and install tediously again and again. Yum provides commands to find, install, and delete a certain, a group or even all software packages, and the commands are concise and easy to remember.
(2) yum software warehouse configuration file (/etc/yum.reops.d/rhel-source.repo)
All information of yum is stored in a configuration file called yum.reops.d directory, usually located in /etc/yum.reops.d directory, the rhel-source.repo file in this directory is The configuration file of the yum software warehouse; the following experiments are based on the modification of this configuration file;
Where:
- name=Red Hat Enterprise Linux —–>specific yum source name
- baseurl —–>mirror server address, you can only write a specific address;
- enabled=1 —–>Enable warehouse, 1 is enabled, 0 is disabled;
- gpgcheck=1—->use the public key to verify the correctness of rpm, 0 is disabled;
- gpgcheck—->If it is 1, the downloaded rpm will be verified by gpg, and the verification key is gpgkey. Generally, your own yum source does not need to be checked.
2. Build a YUM software warehouse based on file (local), ftp service and http service
(1) Based on local Yum software repository
1.1> Configure IP and restart network service;
1.2> Check the configured IP address;
1.3> Mount: mount /dev/sr0 To the /mnt directory;
1.4> Modify the configuration file of yum;
- baseurl=file:///mnt ——–> Change the mirror server address to the local yum source address;
1.5> Test whether the local yum software warehouse is successfully established;
1.6> For testing, use yum local warehouse to install the service;
(2) yum software warehouse based on ftp service
2.1> Lab environment:
Server IP: 192.168.10.10
.
Client IP: 192.168.10.20
2.2> Configure the server IP and restart the network service
2.3> View the configured server IP address;
2.4> Configure the client IP and restart the network service;
2.5> View the configured IP address;
2.6> Install and start the ftp service on the server side;
2.7> Check whether the FTP service is running normally
2.8> Mount /dev/sr0 to the /mnt directory;
2.9> Create a folder rhel6.5 in the /var/ftp directory, and copy the mount file to this folder
<a id="210_rhelsourcereporhelsourcerepohttpsimgblogcsdnimgcn201908032In the client, open rhel-source.repo file. And modify the rhel-source.repo file as follows;
2.11> Test whether the yum software warehouse is successfully established;
2.12> for testing, use the yum repository to install the service;
(3)Yum software repository based on http service
3.1> Lab environment
Server: IP address 192.168.10.10
Client: IP address 192.168.10.20
3.2> Configure the server IP and restart the network service;
3.3> View the server IP after configuration
3.4> Configure the client IP and restart the network service;
3.5> View the configured client network card information;
3.6> Install and start the http service on the server side;
3.7> Check whether the http service is running normally;
3.8> Mount /dev/sr0 to the /mnt directory;
3.9> Create a folder rhel6.5 in the /var/www/html/ directory, and copy the mount file to the folder
3.10> In the client, open the rhel-source.repo file. And modify the rhel-source.repo file as follows;
3.11> Test whether the yum software warehouse is successfully established;
3.12> for testing, use the yum warehouse installation service;