当前位置:网站首页>Two methods of building Yum source warehouse locally
Two methods of building Yum source warehouse locally
2022-04-23 09:20:00 【King_ nul】
List of articles
Preface
yum There are two ways to build a source
1、 Local yum Build the source warehouse
2、 The Internet yum Source
This article will explain in detail how to build a local yum Source warehouse ( We often encounter the need to use the source when the server is offline , So we need to build our own yum Source warehouse for other servers to connect, access and download )
Tips : The following is the main body of this article , The following cases can be used for reference
One 、yum What is it? ?
The following is an introduction from Baidu Encyclopedia
Yum( Its full name is Yellow dog Updater, Modified) It's a Fedora and RedHat as well as CentOS Medium Shell Front end package manager . be based on RPM Package management , Can be automatically downloaded from the specified server RPM Package and install , Dependency relationships can be handled automatically , And install all the dependent packages at once , No need to download it over and over again 、 install .
To put it simply yum It is a gathering place of large installation packages , The software you need to use is downloaded from this place ,yum Will automatically install the software you need Other software or tools ( Dependency package ) Help you install , It's very convenient and easy to use .
Two 、 To configure yum The steps of the source (http edition )
1. Upload image file
use first ssh Connect virtual machine or server ( Recommended CRT The tool does not need to install additional plug-ins )
Connect the server and click the small computer with lock in the upper right corner to transfer files
Drag the file into the window on the right to transfer and select binary transfer
2. Backup yum Source creation http.repo file
# stay root View the uploaded image file
[root@master ~] ll
total 13402504
-rw-------. 1 root root 1551 Dec 26 11:58 anaconda-ks.cfg
-rw-r--r--. 1 root root 4470079488 Oct 30 03:57 CentOS-7-x86_64-DVD-1804.iso
-rw-r--r--. 1 root root 9254078464 Oct 31 09:37 chinaskills_cloud_paas.iso
# Backup source
[root@master ~] mv /etc/yum.repos.d/ /home/
# This is what we backed up yum Source
[root@master ~] ls /home/
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-Media.repo
CentOS-Debuginfo.repo CentOS-Sources.repo
# establish http.repo Source file ( To configure http.repo The local default path of the file )
[root@master ~] vi /etc/yum.repos.d/http.repo
#http.repo Content
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
#wq Save and exit
# Create a new folder centos
[root@master ~] mkdir /opt/centos
# thus yum Your native configuration is complete
3. Image file mount (mount To temporarily mount and restart, you need to mount again )
The process is as follows ( Example ):
# Mount image to /mnt/
[root@master ~] mount -o loop CentOS-7-x86_64-DVD-1804.iso /opt/centos ## This is the root directory ( Because my image file is in the root directory )
[root@master ~] mount -o loop The path where the image file is located /opt/centos
[root@master ~] ll /opt/centos/
total 320
-rw-r--r--. 1 root root 14 Dec 26 14:00 CentOS_BuildTag
drwxr-xr-x. 3 root root 35 Dec 26 14:00 EFI
-rw-r--r--. 1 root root 227 Dec 26 14:00 EULA
-rw-r--r--. 1 root root 18009 Dec 26 14:00 GPL
drwxr-xr-x. 3 root root 57 Dec 26 14:00 images
drwxr-xr-x. 2 root root 198 Dec 26 14:00 isolinux
drwxr-xr-x. 2 root root 43 Dec 26 14:00 LiveOS
drwxr-xr-x. 2 root root 221184 Dec 26 14:02 Packages
drwxr-xr-x. 2 root root 4096 Dec 26 14:02 repodata
-rw-r--r--. 1 root root 1690 Dec 26 14:02 RPM-GPG-KEY-CentOS-7
-rw-r--r--. 1 root root 1690 Dec 26 14:02 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Dec 26 14:02 TRANS.TBL
# Clear cache && List all sources repo package
repo id repo name status
centos centos 3,971
repolist: 3971
# It's here repolist : Number After that, it shows that our local source can be used
4. To configure httpd service
The process is as follows ( Example ):
# install httpd service
[root@master ~] yum install -y httpd
# After the installation is completed, please wait http Created in the default access directory centos Folder
[root@master ~] cd /var/www/html/
[root@master html] ll
total 0
[root@master html] mkdir centos
[root@master html] ll
total 0
drwxr-xr-x. 2 root root 6 Dec 27 13:52 centos
# take /opt/centos Download the mounted file cp To http Default access directory
[root@master html] cp -rfv /opt/centos/* /var/www/html/centos/
# start-up httpd service 、 Boot from boot
[root@master html] systemctl start httpd && systemctl enable httpd
# change http.repo Configuration of file access address
[root@master html] vi /etc/yum.repos.d/http.repo
#text
[centos]
name=centos
baseurl=http://master/centos # here master It's my hostname , You need to make a host preset , It is recommended to use ip Address
gpgcheck=0
enabled=1
# Clear cache list rpm package
[root@master ~]# yum clean all && yum repolist
repolist: 4,139
# Here comes the number Just explain http.repo The source warehouse is ready to use
# You can use other servers to directly configure the source file address to baseurl=http:// Source warehouse ip/centos Visit our yum Install the software in the source warehouse
3、 ... and 、 To configure yum The steps of the source (ftp edition )
1. Preparation
repeat http The first three steps of version
2. To configure vsftpd service
Example :
# install vsftpd service
[root@master ~] yum install -y vsftpd
# To configure vsftpd.conf file (ftp Configuration file for )
[root@master ~] vi /etc/vsftpd/vsftpd.conf
# Add... To the configuration file
anon_root=/opt
wq Save and exit
# Turn on ftp
[root@master html] systemctl start vsftpd && systemctl enable vsftpd
# stay http.repo Change the address to ftp The interview of
[root@master ~] vi /etc/yum.repos.d/http.repo
[centos]
name=centos
baseurl=ftp://master/centos
gpgcheck=0
enabled=1
# Check again to see if you can list the software
[root@master ~] yum clean all && yum repolist
# Can be listed ,ftp The source warehouse is ready , If something goes wrong , Please check for yourself http.repo Is there any error in the address in , Or whether to turn on ftp service
summary
So the content here is Two local yum Construction methods and steps of source warehouse , Local yum The construction of source warehouse is often needed , It can help us install the required software and build the required environment offline .
( Thank you for watching , If there is any mistake, please point out )
版权声明
本文为[King_ nul]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230629527979.html
边栏推荐
- How to read excel table to database
- Go language learning notes - language interface | go language from scratch
- npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
- 《数字电子技术基础》3.1 门电路概述、3.2 半导体二极管门电路
- 三、6【Verilog HDL】基础知识之门级建模
- Go language self-study series | golang method
- Failed to prepare device for development
- ALV树(LL LR RL RR)插入删除
- Valgrind et kcachegrind utilisent l'analyse d'exécution
- How does kubernetes use harbor to pull private images
猜你喜欢
Download and install bashdb
kettle实验
Vivo, hardware safe love and thunder
三、6【Verilog HDL】基础知识之门级建模
3、 6 [Verilog HDL] gate level modeling of basic knowledge
Go language learning notes - exception handling | go language from scratch
GoLand debug go use - white record
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
653. 两数之和 IV - 输入 BST
Chapter VIII project stakeholder management of information system project manager summary
随机推荐
[Luke V0] verification environment 2 - Verification Environment components
I don't understand time, timestamp and time zone. Look at this article
Strength comparison vulnerability of PHP based on hash algorithm
Non duplicate data values of two MySQL query tables
Employee probation application (Luzhou Laojiao)
Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail
Canary publishing using ingress
108. 将有序数组转换为二叉搜索树
【读书笔记】《Verilog数字系统设计教程》 第5章 条件语句、循环语句和块语句(附思考题答案)
112. Path sum
653. Sum of two IV - input BST
Enter "net start MySQL" and "system error 5. Access denied" appears. Detailed explanation of the problem
Technological innovation in government affairs in the construction of Digital Government
Multi view depth estimation by fusing single view depth probability with multi view geometry
Kettle experiment conversion case
Get trustedinstaller permission
On array replication
Go language self-study series | golang nested structure
NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’
Kettle experiment (III)