Linux entry record: 20, Linux package management tool YUM

Source: Internet
Author: User

First, YUM (Yellowdog Updater, Modified) 1. About Yum

RPM Package Form Management software is convenient, but requires manual troubleshooting of package dependencies. Many times installing a software first requires installing 1 or more (sometimes hundreds) of other software, and manually solving the dependency problem is complicated. Use YUM to solve this problem. Linux is also managed by YUM for software packages (including graphical interfaces).

2. Design goals

YUM (Yellowdog Updater, Modified) is a character front-end package Manager based on RPM package management, designed primarily to automatically resolve RPM dependency issues. Its characteristics are as follows:

    • Automatically resolve dependencies
    • You can group RPMs and install actions based on groups
    • Introduction of warehouse concepts to support multiple warehouses
    • Simple configuration (/etc/yum.conf and/etc/yum.repos.d/*.repo)

Second, the Yum Warehouse (Repository) 1. Warehouse Introduction

YUM introduces the concept of a warehouse (Repository), which is used to store all existing RPM packages. When installing a RPM package with Yum, if there is a dependency, YUM will automatically look for dependencies in the repository and install them. Warehouses can be local, or they can use a centralized, unified network repository via HTTP, FTP, or NFS. YUM manages RPM packages well with warehouses.

2. Configuration files

There are 2 types of YUM profiles:

(1) YUM's master Profile/etc/yum.conf, which provides a common configuration for all warehouses. The configuration parameter format is as follows:

[main]cachedir=/var/cache/yum/$basearch/$releasever   Package Cache directory Keepcache=0      if the cache debuglevel=2 debug level is preserved after installation     , Default is 2 (0~10) logfile=/var/log/yum.log   log file exactarch=1      whether the platform needs to be fully matched Obsoletes=1      whether you need to check for expired warehouses gpgcheck=1       whether to check the integrity and legality of the package Plugins=1        allows the Yum plugin feature to be supported Installonly_limit=5        allow the number of kernel packs to be retained bugtracker_url=http:// bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category= Yumdistroverpkg=centos-release  Specifies a package, yum will determine your distribution based on this package, centos default Centos-release

(2) The configuration file of each warehouse/etc/yum.repos.d/*.repo. The configuration parameter format is as follows:

[Base]           Warehouse name, must be unique name=centos-$releasever-base   description information mirrorlist=http://mirrorlist.centos.org/?release= $releasever & Arch= $basearch &repo=os&infra= $infra   Mirror list, which is dynamically obtained from this address baseurl#baseurl=http://mirror.centos.org/centos/ $releasever/os/$basearch/   True warehouse address, you can enable multiple enabled=1        whether the warehouse Gpgcheck=1       whether the package is checked for legality gpgkey=file:///etc/ Pki/rpm-gpg/rpm-gpg-key-centos-6 the file path where the public key for the package is located Enablegroups=1   whether the package is managed based on groups failovermethod={roundrobin| Priority} has multiple URLs to choose from, yum selection order, default Roundrobin (random selection) cost=1000        Warehouse Precedence, default 1000 Remarks section:    Base Library: Packages (CD-ROM) typically provided for the system release Updates    Library: Storing the update package    Extra Library: Storing additional packages    Epel Library: Epel library file

  

Third, Yum basic commands

Common commands for the YUM management software package are:

Yum Install Package-name  installs the specified package yum remove package-name   Uninstall the specified package Yum update package-name   upgrade the specified package

  

Four, yum query
Yum search keyword          keyword search related packages yum list [all|installed|recent|updates]   list [All | installed | latest | update] all packages Yum Info Package-name       Query Package information yum whatprovides filename   query which package provides the destination file

  

V. Create a Yum repository

You can manually create a YUM warehouse in the following ways:

1. Copy all rpm files to a folder

2. Manually install the Createrepo software via the rpm command

3. Run createrepo-v/rpm-directory

4. If you have group information, then use the-G parameter to specify the grouping file when you run the command again

Createrepo-g/tmp/*comps.xml/rpm-directory

(Centos/rhel group information is saved in the disc directory repodata/, the file name ends with comps.xml )

Once created, the machine can be used directly in file mode, or it can be shared via HTTP, FTP, or NFS protocol.

Six, yum cache (caches)

YUM has a lot of caches to speed up, but sometimes the cache can cause some failures, and the cache is cleaned with the following command:

Yum Clear All

The cache is generated each time you run a YUM installation or query for a class of commands.

The Ok,linux Entry record series is temporarily over.

Reference links: Yum usage and Yum source configuration

Linux entry record: 20, Linux package management tool YUM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.