Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the use of YUM warehouses

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to configure the use of YUM warehouse, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The installation program through source code compilation has unparalleled advantages in flexibility and customization, but it is precisely because this feature brings additional maintenance overhead to administrators. There are some limitations when applied in large-scale server clusters. Then you need to use the YUM software repository.

Brief introduction of YUM Software Warehouse

With the help of YUM software warehouse, the tasks of installing, uninstalling and automatically upgrading rpm software packages can be completed, and the lazy relationship between rpm packages can be found and solved automatically, without the need for administrators to manually install each rpm package one by one, which makes it easier for administrators to maintain a large number of Linux servers. Especially in the local network with a large number of Linux hosts, building a source server can greatly alleviate the dependence on Internet such as software installation and upgrade.

To put it simply, YUM repository is the software update mechanism built by 1.RPM package; 2. Automatically resolve dependencies; 3. The software package is 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 lazy software. the server that provides the software repository is also called the "source" server. Detailed explanation of YUM warehouse configuration and commands

Deploy YUM software repository 1. Prepare the network installation source (server side)

YUM software repositories are usually released with the help of HTTP or FTP protocols, so that software source services can be provided to all clients in the network. In order to facilitate the client to query the software package and obtain the lazy relationship and other information, the warehouse data (repodate file) needs to be provided in the software repository, in which all the rpm header information in the directory is collected.

The source of RPM package 1.CentOS released a collection of RPM packages; 2. A collection of RPM packages released by third-party organizations; 3. User-defined collection of RPM packages.

1. Prepare the software repository directory

In the installation CD of the centos 7 system, repodate data has been established for the software directory Packages. Therefore, as long as the contents of the entire CD-ROM are released through HTTP and FTP, it can be used as a software repository.

[root@localhost ~] # rpm-ivh / mnt/Packages/vsftpd-3.0.2-21.el7.x86_64.rpm// install the FTP service through rpm [root@localhost] # mkdir / var/ftp/centos7 [root@localhost ~] # cp-rf / mnt/* / var/ftp/centos7/// create a directory (you can customize it Must be in a directory where you can access the FTP service anonymously) / / and then copy everything under the CD to that directory

For software packages collected by users on non-Centos 7 CDs. In addition to the corresponding directories that need to be prepared, you also need to manually create repodate files, which requires the use of createrepo tools.

[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] # createrepo. / / use the createrepo tool to create the repodate file, / / and make sure that the data file is stored in the current directory

two。 Start the FTP service and ensure that anonymous users can access it properly

[root@localhost ~] # systemctl start vsftpd [root@localhost ~] # systemctl enable vsftpd// starts the FTP service and sets it to boot [root@localhost ~] # ftp 127.0.0.1Connected to 127.0.0.1 (127.0.0.1) .220 (vsFTPd 3.0.2) Name (127.0.0.1:root): / / Direct enter 530 Permission denied.Login failed.ftp > / / Test FTP service can be accessed anonymously. Configure the software repository location (client)

The software repository information used by the yum tool is stored in the / etc/yum.repos.d directory with the extension ".repo" (it is recommended that the original files in the directory be moved out of the specified directory), and 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 warehouse The contents are as follows: # create and install the rpm package [ftp] / / Warehouse IDname=ftp / / Warehouse name in the CD image published through FTP, and customize The baseurl= ftp://192.168.1.1/centos7 / / URL access path can be ignored (the FTP service must be specified to the parent directory of the repodate data file) enabled=1 / / whether to enable the software repository (1 enabled, 0 not enabled) the default value is 1 This option ignores gpgcheck=1 / / whether to verify the signature of the package (1 enable 0 do not enable) gpgkey= file://etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 / / specify the location of the public key file # create and install the rpm package [ftp1] name=ftp1baseurl= ftp://192.168.1.1/otherenabled=1gpgcheck=0 / / which publishes non-CD images through FTP. There are no special requirements, this item is generally 0 Signature authentication of the software is not enabled # rpm package [http] name=httpbaseurl= http://192.168.1.1 / / HTTP service in the CD image published by HTTP Simply specify the IP address of the HTTP service to enabled=1gpgcheck=0# if the CD is mounted locally [local] name=localbaseurl= file:///mnt / / specify the location where the CD image is mounted enabled=1gpgcheck=0 use the yum tool to manage the software package

The yum tool is the most commonly used YUM client tool in the CentOS 7 server and is provided by the default installation of the yum-3.4.3-150.el7.centos.noarch package.

1. Query software package

1.yum list-query the list of packages

[root@localhost] # yum list// can get the software installation 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 in the system [root@localhost ~] # yum list available// lists only packages available in the software repository (but not yet installed) [root@localhost ~] # yum list updates// lists packages that can be upgraded

2.yum info-- query the description of the package

[root@localhost ~] # yum info vsftpd// add package View detailed description Information loaded plug-in: fastestmirror, langpacks source'a'is not specified in the configuration file Use identity instead of Loading mirror speeds from cached hostfile installed package name: vsftpd Architecture: x86 packages 64 version: 3.0.2 release: 21.el7 size: 348 k Source: installed introduction: Very Secure Ftp Daemon URL: 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 the specified software package

[root@localhost ~] # yum search vsftpd// query software packages related to vsftpd [root@localhost ~] # yum search vsftpd// enlarge the scope of query 2. Install, upgrade and uninstall software packages

When operating with the yum command, lazy relationships between packages are automatically checked and resolved, during which the user is prompted to press "y" to confirm. If you want automatic confirmation, "`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// to clear the YUM cache information above is all the content of the article "how to configure the use of YUM repository" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report