Home > Article > Operation and Maintenance > What is centos7 yum
In centos7, the full name of yum is "Yellowdog update Modified", which is a Shell front-end package manager in Fedora, RedHat and SUSE. Yum is based on RPM package management and can automatically download and install RPM packages from designated servers.
#The operating environment of this tutorial: centos7 system, thinkpad t480 computer.
Yum is the abbreviation of Yellowdog update Modified. It is a Shell front-end package manager in Fedora, RedHat and SUSE.
Based on RPM package management, it can automatically download and install RPM packages from a designated server. It can automatically handle dependencies and install all dependent software packages at once, without the need to download and install them again and again.
yum provides commands to find, install, and delete a certain, a group, or even all software packages. The commands are concise and easy to remember.
The purpose of yum is to automatically upgrade, install/remove rpm installation packages (that is to say, the yum command operates on RPM packages), collects rmp-related information, checks dependencies, and prompts users solve.
The key to yum is to have a reliable repository. As the name suggests, this is the software warehouse. It can be an http or ftp site, or a local software pool, but it must contain the rpm header and rmp header. The header includes various information about rmp, including description, function, provided files, dependencies, etc. It is by collecting this information that the remaining tasks can be completed automatically.
Yum itself is a system that automatically manages installation packages running on Linux. The idea of yum is to use a central repository (repository) to manage the interrelationships of a part or even a distribution of applications, and perform related upgrades, installations, deletions, etc. based on the calculated software dependencies, reducing the dependencies that Linux users have always had a headache for. question.
At this point, yum and apt are the same. apt was originally used by debian deb type software management, but now it can also be used by rpm under RedHat.
1. Multiple repositories can be configured at the same time
2. Simple configuration file (generally the configuration file is /etc/yum.conf )
3. Automatically solve dependency problems encountered when adding or deleting rpm packages
4. Keep consistent with the rpm database
yum configuration file, its absolute path is generally: /etc/yum.conf. All configuration information of yum is stored in this file, which is the most important content in the yum system.
Yum.conf is generally divided into two parts: main and repository, but by default there is only the main part. Each yum.conf can only have one main section. The repository section defines the specific configuration of each source/server, which can be one or more. Often located in various files in the /etc/yum.repo.d directory.
Use cat /etc/yum.conf to view the contents of the file.
1.cachedir: This item is the cache directory of the RPM package downloaded by yum. yum stores the downloaded rpm package and database here
2.keepcache : Whether the cache is saved, 1 means retaining the software package after installation, 0 means deleting the software package after installation
3.debuglevel: Error log level, the level is 0-10, the default is 2 (only installation and deletion records are kept )
4.logfile: Stores records of system update software. Users can check what updates they have made in the past days in the file configured by this configuration item
5. pkgpolicy: Package policy. There are two options, newest and last. This function is if you set up multiple repositories, and the same software exists in different repositories at the same time, which one yum should install. If it is newest, yum will install the latest version. . If it is last, yum will sort the server IDs alphabetically and select the software installation on the last server.
6.distroverp: Specify a software package. Yum will determine your release version based on this package. The default is RedHat-release, or it can be any rpm installed for your own release. Bag.
7.tolerent: There are also two options, 1 and 0, indicating whether yum tolerates package-related errors on the command line. For example, you want to install three packages 1, 2, and 3. , and 3 of them have been installed before. If you set it to 1, yum will not show an error message. The default is 0.
8.exactarch: There are two options, 1 and 0, which represent whether to only upgrade the package with the same cpu system as the software package you installed. If it is set to 1, it will be as if you installed a i386 rpm, yum will not use the 1686 package to upgrade.
9.retries: The number of retries after a network connection error occurs. If set to 0, it will retry infinitely.
10.obsoletes: This is an update parameter. For details, please refer to yum(
8
). Simply put, it is equivalent to upgrade and allows updates. Old RPM packages.
11.gpgcheck: Whether to check GPG (GNU Private Guard), a key signature.
12.plugins: Whether to allow the use of plug-ins, the default is
0
not allowed , but we generally use the yum-fastestmirror plug-in.
13.installonly_limit: How many kernel packages are allowed to be retained.
14.exclude: Shield RPM packages that you do not want to update. Wildcards can be used, and spaces are used to separate multiple RPM packages.
15.reposdir: This option allows users to specify the absolute path to the .repo file. The .repo file contains information about the software repository (same as the [repository] section in the /etc/yum.conf file). reposdir=[absolute path to the directory containing the .repo file]
16.bugtracker_url:trackingbugpath
Usage: man 5 yum.conf # Detailed explanation of yum.conf is available
#yum’s working mode is C/S architecture:
##ServerEnd(yumwarehouse): Dependency library, original file, verification code file.
Client: yumClient program, configuration file (ConnectionServerPath Information). #
#When executing the yum command, the address of the software warehouse will first be obtained from the many repo files in the "/etc/yum.repo.d" directory and Download "metadata". "Metadata" includes the package names of all software packages registered in the software warehouse and their required dependency environments. After yum obtains this information, it will compare it with the local environment and then list and confirm it. Which packages need to be installed, and the installation will start after the user confirms.
"Metadata" is indexed by repomd.xml located in the repodata directory in the path related to the yum source server.
##yum system workflow:
##Server side: All rpm packages are stored on the server, and then the dependencies of each rpm file are analyzed using related functions, and these data are recorded into files. Stored in a specific directory on the server.
##Client: If you need to install a certain software, first download the dependencies recorded on the server Sexual relationship files (can be through WWW or FTP), by analyzing the record data downloaded from the server, and then obtaining all related software, downloading them all at once for installation. #
What is a repo file? The repo file is the configuration file of the yum source (software warehouse) in Fedora. Usually a repo file defines the details of one or more software warehouses, such as where we will download the software packages that need to be installed or upgraded, and the settings in the repo file. The content will be read and applied by yum!
# Enter the /etc/yum.repos.d/ directory and you can See that there are three files as follows by default:
## Where CentOS-Base.repo is the configuration file of the yum network source (usually this is used) CentOS-Debuginfo .repo debug package, especially kernel-related updates and software installation
CentOS-Media.repo This is a file that is called after being mounted using a CD (I don’t have it on my machine)
CentOS-Vault. repo This is the old version of yum source configuration added to the latest new version (no...)
epel.repo: EPEL (Extra Packages for Enterprise Linux) is created by the Fedora community and is distributed for RHEL and derivatives Versions such as CentOS and other projects that provide high-quality software packages. After installing EPEL, just like on Fedora, you can use yum install package name to install many software that needed to be compiled and installed before, commonly used software or some more popular software, such as the now popular nginx, htop, ncdu , vnstat, etc., can be easily installed and updated using EPEL. You can install it directly by executing the command:
yum install epel-release. If it cannot be installed, refer to:
yum command formatThe command form of yum is generally as follows :
yum [options] [command] [package ...] The [options] are optional, and the options include -h (help), -y ( When prompted during the installation process, select "yes" for all), -q (do not display the installation process), etc. [command] is the operation to be performed, and [package...] is the object of the operation.
1.OPTIONS
--nogpgcheck: gpg check is prohibited;
-y:
The automatic answer is "yes"; ##, do not output display information;
--disablerepo=repoidglob: Temporarily disable the repo specified here; --enablerepo=repoidglob: Temporarily enable the repo specified here; ; ..com.com #COMMAND (1)Display warehouse list:repolist yum repolist [all|enabled|disabled] [All|available|unavailable] See: https://blog.csdn.net/xmm1981/article/details/ 78258176 Recommended: "centos usage tutorial"
The above is the detailed content of What is centos7 yum. For more information, please follow other related articles on the PHP Chinese website!