Linux Basic Operation Yum Package Manager

Source: Internet
Author: User

In the CentOS system, the core of the Package Manager is RPM:
The RPM command line tool used on the backend;
The previous section uses the Yum command-line tool or the DNF command-line tool;


Pre-section tools for package management:
Rhel/centos series release Linux, Yum and DNF;

Yum command-line tools:
Yellow Dog Updater Modifier

Software Warehouse: Package Repository
In the software warehouse, a large number of RPM packages are stored, and the properties information of all RPM packages is extracted and stored in XML format documents;

The URL tag and location of the software warehouse are used, and the contents of the XML document created in the repository can be directly read and cached locally;
URL: Uniform Resource Locator;
Schema://[[email protected]]hostname[:p Ort][/path/to/resource] [Parameters][flag]
Schema
http
Ftp
File
...

Yum is the model of the C/s architecture, the server is actually the software warehouse, the client needs to fill in the specified configuration file the correct URL, in order to be able to access through the correct protocol to the software warehouse packages;

On the server, the repository is actually a directory that contains the package files and the metadata files corresponding to those packages, and all the metadata files are placed in the directory named "Repodata";

Createrepo command:
Createrepo [Options] <directory>

On the client, use the configuration file to the server's URL to point to:
Yum master configuration file:/etc/yum.conf
Yum fragment configuration file:/etc/yum.repos.d/*.repo
The fragment configuration file has INI-style configuration mode: That is, segmented configuration content;
1. Use "[Repositoryid]" to uniquely identify the software warehouse;
2. Other configuration information is similar to the replication of variables, i.e. key=value;
3. All configuration information under the tag of the Software warehouse is in effect for the warehouse above it, until the next pair of "[]" is encountered;

In each fragment profile, you can configure the point of one or more warehouses: and, when the Yum program looks at each warehouse, it is possible to find more than one Yum warehouse at a time, and to select the most recent version of the desired program from all the available warehouses and cache it locally for installation, upgrade, and other operations:
Multiple warehouses under the same repoid are called mirrors, and only one warehouse is used;
Many different repoid warehouses can be used at the same time;

Content format of. Repo file:
[Repositoryid]
Name=full Name of Repository
Baseurl=schema1://hostname/path
Schema2://hostname/path
...
ENABLED={0|1}
GPGCHECCK={0|1}
Gpgkey=schema://hostname/path/to/public_key
such as: gpgkey=file:///mnt/cdrom/rpm-gpg-key-centos-7
Failovermethod={roundrobin|priority}
Yum command-line tools:
Yum-yellowdog Updater Modified
command is one of:
* Install Package1 [Package2] [...]
* Update [PACKAGE1] [Package2] [...]
* Update-to [Package1] [Package2] [...]
* Update-minimal [Package1] [Package2] [...]
* Check-update
* upgrade [Package1] [Package2] [...]
* Upgrade-to [Package1] [Package2] [...]
* Distribution-synchronization [Package1] [Package2] [...]
* Remove | Erase Package1 [Package2] [...]
* Autoremove [Package1] [...]
* List [...]
* Info [...]
* provides | Whatprovides Feature1 [Feature2] [...]
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
* Makecache [FAST]
* Groups [...]
* Search string1 [string2] [...]
* Shell [filename]
* RESOLVEDEP DEP1 [DEP2] [...]
(Maintained for legacy reasons Only-use Repoquery or Yum provides)
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
* Reinstall Package1 [Package2] [...]
* Downgrade Package1 [Package2] [...]
* Deplist Package1 [Package2] [...]
* Repolist [all|enabled|disabled]
* Repoinfo [all|enabled|disabled]
* Repository-packages <enabled-repoid> <install|remove|remove-or-reinstall|remove-or-
distribution-synchronization> [Package2] [...]
* Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo
]
* History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|roll‐
Back|new|sync|stats]
* Load-transaction [Txfile]
* Updateinfo [Summary | list | info | remove-pkgs-ts | exclude-updates | exclude-all |
Check-running-kernel]
* Fssnapshot [summary | list | have-space | create | delete]
* FS [filters | refilter | refilter-cleanup | du]
* Check
* Help [command]

-Y,--assumeyes: "Yes" is the answer to the question of the user interacting with the Yum during execution;
-Q,--quiet: Quiet mode, in a single installation transaction, do not output any information;
--enablerepo=repoidglob:
Even if the specified repoid is disabled, it can be enabled by this option;
--disablerepo=repoidglob:
Even if the specified repoid is normally enabled, it can be disabled by this option;
--noplugins: During yum execution, it is clear that no plugins are used;
--nogpgcheck: During yum execution, it is clearly stated that no package integrity authentication is performed;

command is one of:

Install package
* Install Package1 [Package2] [...]

Attention:
1. If only the program name is given when the installation is enabled, and no information such as the program version, platform type, and operating system type is given, Yum will search all the enabled warehouses and find the latest version of the package to install;
2. If the installation is enabled with a program name with the program version, platform type and operating system type information, then in all warehouses to find the exact matching package to install;
3. If the full package name is given when the installation is enabled, only a specific package can be found for installation;
4. The package name or program name can use the wildcard character (Globbing), *? [] [^]

Upgrade and downgrade the installer package to allow packages to change between versions;
* Update [PACKAGE1] [Package2] [...]
* Downgrade Package1 [Package2] [...]

Uninstalling packages
* Remove | Erase Package1 [Package2] [...]

To view packages:
* List [Available|installed|all]

To view information about a package:
* Info [...]

To clear local related cache information:
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]

To build the local cache manually:
* Makecache [FAST]

Displays information about all available warehouses and, if the cache disappears, the display first;
* Repolist [all|enabled|disabled]

Fuzzy Search:
* Search string1 [string2] [...]

Package Group Management Commands:
* Groups [...]
Group Install
Group Update
Group List
Group Remove
Group Info

Displays all dependencies for the specified package:
* Deplist Package1 [Package2] [...]

Reply to Yum installation transaction
* Load-transaction [Txfile]

The third Epel warehouse provided by fedora, download the epel-release-latest-7.noarch.rpm package to any mirror site, and install it locally using RPM or Yum on Linux, in/etc/ Generate a Epel.repo configuration file in the YUM.REPOS.D directory;

Common variables in the repo configuration file for Yum:
$basearch: The underlying platform architecture type used by the current computer;
i686
x86_64 (AMD64)
Ppc
Ppc64

$releasever: The major version number of the current operating system release version;
For example: Centos 7.0-1511, its release major version number is 7;
Centos 6.9 with a release number of 6;

$aech: Platform Architecture type

$YUM 0-$YUM 9:yum built-in 10 variables that can be customized by a user;

Linux Basic Operation Yum Package Manager

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.