Deployment warehouse

catalogue

preface

I YUM overview

II Building CentOS 7 software warehouse

III Add unofficial RPM package group in software warehouse

IV Specify the YUM warehouse location for the client

V Local YUM warehouse

Vi YUM tool overview

VII YUM common commands

Summary

preface

Learning YUM software warehouse can complete the tasks of installing, uninstalling and automatically upgrading rpm software packages, and can automatically find and solve the dependencies between rpm packages without the need for 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 the local network with a large number of Linux hosts, building a "source" server can greatly alleviate the dependence on the Internet for software installation and upgrading.  

I YUM overview

The predecessor of YUM is YUP (Yellow dog Updater, Software Updater of Yellow dog Linux). It was originally developed by TSS (Terra Soft Solutions, INC.) using Python language. Later, it was improved by the Linux development team of Duke University and named YUM (Yellow dog Updater, Modified). To successfully use the YUM mechanism to update the system and software, you need to have a software repository containing various rpm installation package files and their dependent software. The server providing the software warehouse is also called the "source" server. As long as the address and other information of the software warehouse are correctly specified in the client, you can use the corresponding "source" Server to install or update software

  • YUM(Yellow dog Updater Modified)
  • Software update mechanism based on RPM package
  • Dependencies can be resolved automatically
  • All software is provided by the centralized YUM software warehouse

Active / standby installation source

  • How to provide software warehouse
  • ftp service: ftp: / /
  • HTTP service: http: / /
  • Local directory: file: / /
  • Source of RPM package
  • Collection of RPM packages published by CentOS
  • Collection of RPM packages published by third party organizations
  • User defined RPM package collection

II Building CentOS 7 software warehouse

  • RPM package from CentOS 7 DVD disc
  • Provide client via FTP
[root@localhost ~]#mkdir -p /var/ftp/centos7
[root@localhost ~]#cp -rf/media/cdrom/* /var/ftp/centos7
 
[root@localhost ~]#rpm -ivh /media/cdrom/Packages/vsftpd-3.0.2-21.el7.x86_64.rpm
[root@localhost ~]#systemctl start vsftpd
[root@localhost ~]#systemctl enable vsftpd

III Add unofficial RPM package group in software warehouse

  • Include all RPM packages that have dependencies
  • Use the createrepo tool to create a warehouse data file
[root@localhost ~]#mkdir /var/ftp/other
[root@localhost ~]#cd /var/ftp/other
[root@localhost other]#createrepo -g /media/cdrom/repodata/repomd.xml ./

IV Specify the YUM warehouse location for the client

Configuration file: / etc / yum.com repos. d/centos7. repo

mount /dev/cdrom /mnt/                # ——Mount the disc in the / mnt directory
 
cd /etc/yum.repos.d/
mkdir repos.bak
mv *.repo repos.bak
 
cd /etc/yum.repos.d/
vim local.repo
[local]                                # ——Warehouse category
name=local                            # ——Warehouse name
baseurl=file:///mnt # -- specify the URL access path as the CD mount directory
enabled=1                             # ——Open this yum source. This is the default item and can be omitted
gpgcheck=0                            # ——Do not verify the signature of the package
 
yum clean all && yum makecache        # ——Delete the yum cache and update it
yum clean                          ● It can be split into two steps
yun makecache

V Local YUM warehouse

  • Directly use CentOS 7 CD as software warehouse
  • Mount the image to the warehouse location. The URL address is file:///media/cdrom
[root@localhost ~]#vi /etc/yum.repos.d/local.repo
.....
[local]
name=name
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0

Vi YUM tool overview

About YUM command

  • Updated by software package yum-3.4.0 3-150. el7. centos. Provided by noarch
  • It is used to access YUM warehouse, query, download, install and uninstall software packages

yum's profile

  • Basic settings: / etc / yum.com conf
  • Warehouse settings: / etc / yum.com repos. d/*. repo
  • Log file: / var / log / yum log

YUM cache directory

  • Store the downloaded software package, warehouse information and other data
yum clean all && yum makecache

VII YUM common commands

yum -y install Software name                # ——Install and upgrade software packages. The "- y" option indicates automatic confirmation
yum -y remove Software name                    # ——Uninstalling a package automatically resolves its dependencies
yum groupremove                          # ——Uninstall software 
yum -y update Software name                    # ——Upgrade package
 
yum list                            # ——Query package list
yum list installed                    # ——Query the installed software packages in the system
yum list available                    # ——Query for packages not installed in the warehouse
yum list updates                    #  ——Query packages that can be upgraded
 
yum info Software name                        #    ——Query package description
yum info httpd
 
yum search [all] key word                # ——Find relevant software packages according to a keyword
yum search all httpd
 
yum whatprovides command                # ——Which package does the query command belong to
yum whatprovides netstat
yum grouplist [Package group name]                    #Query package group
yum groupinfo <Package group name>

Summary

I hope yum can help you update and maintain your Linux server

Keywords: Linux Operation & Maintenance CentOS

Added by Mafiab0y on Tue, 14 Dec 2021 22:35:13 +0200