In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "steps to deploy and configure YUM software repository". In daily operation, I believe many people have doubts about the steps to deploy and configure YUM software repository. I have consulted all kinds of materials and sorted out simple and easy to use operation methods. I hope to help you answer the doubts about "steps to deploy and configure YUM software repository"! Next, please follow the small series to learn together!
Introduction to YUM Software Repository
With the help of YUM software repository, it can complete the tasks of installing, unloading and automatically upgrading rpm software packages, and can automatically find and solve the lazy relationship between rpm packages, without requiring administrators to install each rpm package one by one and manually, making it easier for administrators to maintain a large number of Linux servers. Especially in a local network with a large number of Linux hosts, building an origin server can greatly ease the dependence of software installation, upgrade, etc. on the Internet.
YUM Warehouse is simply:
1. Software update mechanism constructed by RPM package;
2. automatically resolve dependencies;
3. Software packages are provided by a centralized YUM software repository.
To successfully use the YUM mechanism to update systems and software, you need a software repository that contains various rpm installation package files and their dependencies. The server that provides the software repository is also called the "source" server.
YUM Warehouse Configuration and Command Details
Deployment of YUM Software Repository
I. Prepare network installation source (server side)
YUM software repositories are usually distributed using HTTP or FTP protocols, which can provide software source services to all clients in the network. In order for clients to query software packages and obtain information such as dependency relationships, it is necessary to provide repository data (repodate file) in the software repository, in which all rpm header information under the directory is collected.
Source of RPM package
1. RPM package collection published by CentOS;
2. Collection of RPM packages published by third party organizations;
3. A user-defined collection of RPM packages.
1. Prepare software warehouse catalog
On the installation CD for the centos 7 system, repodate data has been established for the software directory Packages. Therefore, the entire CD content can be distributed as a software repository by HTTP and FTP.
[root@localhost ~]# rpm -ivh/mnt/Packages/vsftpd-3.0.2 - 21.el7.x86_64.rpm//Install FTP service at rpm [root@ localhost ~]# mkdir /var/ftp/centos7[root@localhost ~]# cp -rf /mnt/* /var/ftp/centos7///Create a directory (custom, must be in a directory where FTP service can be accessed anonymously)//and copy everything from the CD to that directory
For packages collected by users on non-Centos 7 CDs. In addition to preparing the corresponding directory, you need to manually create the repodate file, which requires the use of the createrepo tool.
[root@localhost ~]# mkdir /var/ftp/other[root@localhost ~]# cd /var/ftp/other//Go to the directory where the rpm package is stored [root@localhost other]#createpo.// Use the createrepo tool to create a redo file,//and specify the location of the data file is the current directory
2. Start FTP service and ensure anonymous users can access it normally
[root@localhost ~]# systemctl start vsftpd[root@localhost ~]# systemctl enable vsftpd//Start FTP service and set it to boot automatically [root@localhost ~]# ftp 127.0.0.1 Connected to 127.0.0.1 (127.0.0.1).220 (vsFTPd 3.0.2)Name (127.0.0.1:root): //Enter 530 Permission denied.Login failed.ftp> //Test FTP service can be accessed anonymously
II. Configuration software warehouse location (client)
The software repository information used by yum tools is stored in the directory/etc/yum.repos.d with the extension ".repo"(it is recommended to move the original files from the directory to the specified directory). The original files are configuration files that can be downloaded directly from the Internet.
[root@localhost ~]# mv /etc/yum.repos.d/* /a[root@localhost ~]# vim /etc/yum.repos.d/a.repo//Create a new YUM repository with the following contents: #Create an rpm package [ftp] that installs a CD image published via FTP //Warehouse IDname=ftp //Repository name, custom, can ignore baseurl=ftp://192.168.1.1/centos7 //URL access path (FTP service must specify to parent directory of repodate data file) enabled=1 //Enable software repository (1 enabled, 0 disabled) Default value is 1, this can be ignored gpgcheck=1 //Verify package signature (1 enabled, 0 disabled) gpgkey=file://etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 //Specify public key file storage location #Create and install rpm package for FTP distribution of non-CD image [ftp1]name= ftp1baseurl =ftp://192.168.1.1/otherenabled=1gpgcheck=0 //There is no special requirement. This item is generally 0. Software signature authentication is not enabled.#rpm package [http]name=httpbaseurl=http://192.168.1.1 in CD image published through HTTP. //HTTP service, just specify the IP address of HTTP service enabled=1gpgcheck=0#If the CD is mounted locally [local]name=localbaseurl=file:///mnt //Locally specify the mount location of the disc image enabled=1gpgcheck=0
Using yum tools to manage packages
On CentOS 7 servers, yum tools are the most commonly used YUM client tools, provided by the default installation of the yum-3.4.3-150.el7.centos.noarch package.
I. Query software package
1. yum list --query package list
[root@localhost ~]# yum list//You can get the software installation status in the system, and you can also query the list of software packages available in the software repository. [root@localhost ~]# yum list installed//lists only packages installed on the system [root@localhost ~]# yum list available//lists only packages available (but not installed) in the repository [root@localhost ~]# yum list updates//lists packages that can be upgraded
2. yum info--Query package description information
[root@localhost ~]# yum info vsftpd//add package View detailed description Plugin loaded: fastestmirror, langpacks Source 'a' name not specified in configuration file, use identifier instead of Loading mirror speeds from cached hostfile Installed package name : vsftpd architecture Version x86_64 : 3.0.2 Release : 21.el7 Size 348k Source : Installed Profile Very Secure Ftp Daemon website https://security.appspot.com/vsftpd.html Protocol GPLv2 with exceptions Description : vsftpd is a Very Secure FTP daemon. It was written completely from : scratch.
3. yum search--Query specified packages
[root@localhost ~]# yum search vsftpd//query vsftpd related packages [root@localhost ~]# yum search vsftpd//enlarge query scope
II. Install, upgrade and uninstall software packages
The yum command automatically checks for dependencies between packages and resolves them, prompting the user to press "y" to confirm. If you wish to confirm automatically,```
You can add the "-y" option after the yum command.
[root@localhost ~]# yum -y install vsftpd//install vsftpd service [root@localhost ~]# yum-y update vsftpd//update vsftpd service [root@localhost ~]# yum -y remove vsftpd//uninstall vsftpd service If the YUM configuration file is written incorrectly, after modifying the configuration file, it is recommended to use [root@localhost ~]# yum clean all//clear the YUM cache information. At this point, the study on "Steps to deploy and configure the YUM software repository" is over. I hope this solves everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.