Installation of Yum source for Linux package management

Source: Internet
Author: User
Tags gpg yum repolist

The Yum source installation is a common approach in our work, which is the RPM-based package manager in Fedora and Redhat and SuSE, which enables system managers to interact and automate the finer and more granular management of RPM packages, to automatically download RPM packs and install them from specified servers, Dependency relationships can be automatically handled and all dependent software packages are installed at once, without the hassle of downloading and installing them over and over again.

In CentOS7 there is also a more innovative installation method (DNF installation), this chapter is mainly about Yum installation. We must master the Yum command before installing the Yum source. Let's talk about the use of the Yum command and the Yum source installation.

I. Usage of the YUM command

The syntax format for the yum command: Yum [options] [command] [package ...]

[Options]

  -Y: Answer "yes" to all questions "  -C,--config=[config file]: Specify profile  -Q: Quiet installation mode  -V: Verbose installation mode  -D: Set debug Level (0-10)  - E: Set Error level (0-10)  -R: Sets the maximum wait time for Yum to process a command;
  -C: Run completely from the cache without downloading or updating any header files
  -H: Display Help information--nogpgcheck: No GPG check is allowed;
--disablerepo=repoidglob: Temporarily disables the repo specified here
--enablerepo=repoidglob: Temporarily enable the repo specified here
--noplugins: Disable all plugins

[Command]

Show Warehouse List
Repolist [all|enabled|disabled]

Show Packages: List
list [All | glob_exp1] [GLOB_EXP2] [...]
list {available|installed|updates} [GLOB_EXP1] [...]

To install the package:
Install Package1 [Package2] [...]

Reinstall Package1 [Package2] [...] (reinstall)

Upgrade Package:
Update [PACKAGE1] [Package2] [...]

Downgrade Package1 [Package2] [...] Downgrade

Check for available upgrades:
Check-update

To uninstall a package:
Remove | Erase Package1 [Package2] [...]

To view the package information:
info [...]

View which package is provided by the specified attribute (which can be a file):
provides | Whatprovides Feature1 [Feature2] [...]

To clean up the local cache:
Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]

All: Clear the cache directory of the package and the old headers

Packages: Clear the package from the cache directory

Headers: Clear headers in cache directory

Metadata: Clear Metadata

Expire-cache: Clear Stale cache

Rpmdb: Working with databases

Plugins: Clear Plugins

Build cache:
Makecache
Search Package:

Search string1 [string2] [...]

[Search for Package name and brief information with specified keywords]

View the capabilities that the specified package depends on:
Deplist Package1 [Package2] [...]

View Yum Transaction history:
History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]

To install and upgrade the local package:
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)

Related commands for package group management:
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]

--------------------------------------------------------------

Second, the Yum Warehouse building complementary knowledge points "to understand the Yum command and the establishment of the Yum warehouse is very important"

1. What is a cloud warehouse? What is the Repodata file inside the Yum warehouse?

Yum Repository: Stores a wide range of RPM packages and related metadata files for packages (placed in a specific directory)

Repodata files: To put related metadata, such as the bread dependency in the Yum warehouse.

2, yum Client configuration file in detail (man yum.conf inside is detailed)

/etc/yum.conf: is a configuration that provides a public configuration for all warehouses "or is not a repository, that is, the configuration of the Yum command"
/etc/yum.repos.d/*.repo: Provides configuration for the point of the warehouse

Detailed description of warehouse point definition:
[Repositoryid]
Name=some name for this repository
baseurl=url://path/to/repository/
Enabled={1|0}
Gpgcheck={1|0}
Gpgkey=url
Repo-gpgcheck the source legitimacy of the GPG information for checking meta data
ENABLEGROUPS={1|0} whether to bulk manage packages based on groups
Failovermethod={roundrobin|priority} Fail-Over method
The default is: Roundrobin, meaning random selection;
Cost= Overhead
Default is 1000
Bandwidt indicates the time-length bandwidth
Username
Password

Note: The configuration file has been modified to enable the configuration file first: Yum repolist

3. Create a Yum Warehouse summary:

(1) package the package under a directory
(2) Creating a metadata file: Createrepo [options] <directory>
(3) Create signature: Createrepo file [file is a folder to put the package, he will automatically generate the public Secretary]
(4) Edit configuration file:/etc/yum.repos.d/centos-base.repo
(5) Run command to get all packages via config file: Yum repolist
(6) Install the local package directly

Installation of Yum source for Linux package management

Related Article

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.