rpm, yum and related source configuration related summary

  Had previously been used in the schools are Ubuntu16.04, usually as a Linux beginner pretty feel good, a few common software-related instructions is pretty remember, "apt install" and the like.

  Work for two months, basically based company uses CentOS server, AMI running even in the AWS above basically is based on CentOS. I was able to experience the biggest difference between CentOS and Ubuntu package management system is probably different, yum on centos / rpm and apt / deb is somewhat different (Although both distributions idea in terms of kernel version too big = =).

  Usually look at some online tutorials, often can see some configuration Sao operating yum package, these operations often seem simple but the actual need, when they often need to take the time to find answers from Google, just to the mood today, the yum / rpm and focus on understanding the source configuration a bit, the following rights record as a note, I hope next time there are issues resolved quickly.

 

0.rpm

  Experience collected from the source code to compile and install the software the students will have trouble this deep image in complex ways, so quick sense of nostalgia when the Windows software installation of a key, rpm is to be able to so quickly install software and design.

Specific details of the article will not start, just know that rpm is a software package organization on the line, but in general there will be a rpm package inside information relating to the dependent packages. Rpm but does not solve a problem, and that is dependent on management issues between software packages, it can be said rpm only the problem of a single software organization, and is the yum package management, in particular, the interdependence between the package management tool.

 

1.yum

  yum The solution is to rely on a tool rpm between management software needed. So we will see the use of the above is when installing CentOS: yum install XXX, but the download is XXX.rpm.

As a rpm package management tool has its client and server-side (the depot) two tissue morphology. The most common yum command basic act locally, often in dealing with warehouses and yum install time.

yum repository (repository) simple point is actually a URL, the software can find the appropriate information from the server through the URL of the local yum client. All the information repository CentOS have been stored in the directory /etc/yum.repos.d below, each of which ends with a repo file defines a plurality of address repo, often this format:

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

among them

[Base] as a warehouse serverid. 

name, a description of the repository to support such variables as $ releasever $ basearch.

There are two options failovermethode roundrobin and priority, meaning there are a plurality of alternative url time, the order of selection yum, roundrobin randomly selected, if the connection fails then the next, followed by cycle, priority according to the order from the url a beginning. If not specified, the default is roundrobin.

enabled = [1 or 0]
when a depot is arranged when enabled = 0, yum warehouse as the package does not provide the source during the installation or upgrade package. With this option, you can enable or disable the software repository. Yum through the --enablerepo = [repo_name] and --disablerepo = [repo_name] option, or by PackageKit "Add / Remove Software" tool, you can easily enable and disable designated depots

gpgcheck and gpgkey related to the authentication package, gpgcheck a switch, gpgkey is gpg public key address, please refer to the specific knowledge of the relevant gpg.

Several variables
$ releasever, release version, part of distroverpkg obtained from the [main], and if not, to judge according to the redhat-release package.
$ Arch, cpu system, such as i686, athlon like
$ basearch, the basic system of cpu group, such as belong athlon i686 and i386, alpha and alphaev6 belong alpha.

This can be seen below the repo directory has more files, which were often enable the repository is not much, is generally a common Base, updates, extras.

Local yum configuration file is /etc/yum.conf, in / etc / yum / directory and some configuration files, some of which are configured yum plug-ins, such as /etc/yum/pluginconf.d/fastestmirror.conf. The plug-in can help you to automatically select the fastest repo.

 

2. Source Configuration

  Many domestic sources can increase the speed of access to our yum package related platforms generally provides guidelines related operations change the source, such as Tsinghua source: https: //mirror.tuna.tsinghua.edu.cn/help / centos /, can be said of another domestic source is very simple.

  But sometimes we are not necessarily satisfied with the support provided by official sources, some third-party software will also provide support for repo, this time we need to manually configure the source:

To kubernetes for example, aliyun in the mirror provides a kubernetes official repositories, https: //mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/, can be accessed from this url to his repo source, but the specific repo file inside the base url how to determine it? In fact, long been seen repodata deep into this folder on the line, base URL at this time is where the URL of the repository. This url will be able to locate a file is written repo yum repository is available, use the command yum repolist be able to see information about the warehouse, will be able to install the appropriate software inside the warehouse after the turn enable.

 

3. impressions

  Knowing but not the why of things and less of the same or very good for software distribution processes on the Linux platform is also associated with a greater understanding, feeling the effect of analogy, enjoyable learning process.

 

Guess you like

Origin www.cnblogs.com/J1ac/p/11026057.html