CentOS RedHat 5 Yum source using the configuration and parameters Detailed

This article belongs to the basic tools of the article under Linux, so experts, veterans, please skip this article after the environment is to be installed CentOS-5.7 system, CentOS yum will comes with two configuration files # cd /etc/yum.repos .d / # ls CentOS-Base.repo CentOS -Media.repo if your server in a foreign country, through both profiles you can directly install the server components required for domestic users but relatively slow download it here recommended the country Yum source, here my original source CN99 is more commonly used, but later after the acquisition was 163, 163 in fact access the same address is: http://mirrors.163.com/ after entering the browser will be seen on the right help information, as shown in 1: [caption id = "attachment_733 " align = "alignleft" width = "648"] 163 mirror [/ caption] because I was CentOS, CentOS point so we use to help new page pops up, click this time instructions corresponding version I CentOS5, so we chose CentOS5, FIG. 2: [caption id = "attachment_736 " align = "alignleft" width = "928"] CentOS Description [/ Caption]                       HTTP: // m irrors.163.com/.help/CentOS5-Base-163.repo Some of Linux may not deep contact with the students to see here do not know what is this page displayed? Yum repo and collaboration here is slightly explain this is like CentOS-Base.repo and CentOS-Media.repo, commonly known as the repo file or depot in front of the repo file names can be named according to their own habits, such as: base .repo, centos.repo and so on. The following excerpt from: http://tc.itkee.com/os/detail-d80.html repo file defines the details of the contents of one or more depots, for example, where we will need to download the installation package or upgrade, set content repo file will be read and applied yum! YUM works is not complicated, each RPM software head (header) which will record the dependencies of the software, so if you can head down to the contents of the record and analyze the need for additional software can know each before installing What basic software installation. In other words, the first tool to analyze all the RPM files in the server above analysis, then analyze the record down, first check the record of the file as long as during the installation or upgrade, you can know all associated software. Therefore YUM basic workflow is as follows: the server side: a server to store all of the above RPM package, and then to analyze correlation functions for each RPM file dependencies, these data records to be stored in a specific file server within the directory. Client: If you need to install a software, first download the server above dependencies documented (by way of WWW or FTP), were analyzed by record data downloaded to the server, then get all the relevant software, all at once downloaded for installation. An excerpt of which the next paragraph to explain the significance of the parameters in which the [base] name = CentOS- $ releasever - Base - 163.com baseurl = http: //mirrors.163.com/centos/$releasever/os/$basearch/ # mirrorlist = http : //mirrorlist.centos.org/ release = $ releasever & arch = $ basearch & repo = os gpgcheck = 1 gpgkey = http:? //mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 1, [base] here brackets "[]" The content we referred to him as serverid serverid which is different for each repository difference, must have a unique name. Repeat the back of the front cover 2, name is a description of repository to support such variables as $ releasever $ basearch, can also customize their own names, all in all, this name = any name. 3, baseurl baseurl server setup is the most important part, only the settings are correct, in order to obtain software from above. Its format is: baseurl = url: // server1 / path / to / repository / url: // server2 / path / to / repository / url: // server3 / path / to / repository / # url which have supported protocols http: // ftp: // file: // three. After baseurl can with multiple url, you can change yourself the faster mirror sites, but baseurl only one, that can not be like the following format: baseurl = url: // server1 / path / to / repository / baseurl = url: // server2 / path / to / repository / baseurl = url: // server3 / path / to / repository / url which points to the directory must be the repository header on a directory, it also supports $ releasever $ basearch this Variables. # Mirrorlist = http: //mirrors.fedoraproject.org/mirrorlist repo = fedora- $ releasever &? arch = $ basearch # above this line is to specify a list of addresses mirror server, usually open, in this case added a note symbol disabled, we can try to replace $ releasever and $ basearch into their own version of the corresponding and architecture, such as 10 and i386, opened in a browser, we can see a long list of mirror mirror server address list available. 4, the relevant variable $ arch, cpu system, such as i686, athlon like the releasever $, release version, available from the [main] distroverpkg portion, if not, it is judged according redhat-release package. $ Basearch, the basic system of cpu group, such as belong athlon i686 and i386, alpha and alphaev6 belong alpha. 5, gpgcheck gpgchkeck = 0 and 1 have two options, whether representing gpg check whether, if this one is not, the default is checked. 6, gpgkey reposity the GPG key, as I said before, yum package can use gpg to verify and ensure the integrity of the download package, so we need to find each repository site gpg key, usually prominently on the front page of Some names such as plain text files RPM-GPG-KEY.txt like, download them, and then use the command rpm --import xxx.txt import them, it is best to release comes with GPG-KEY also import, rpm --import / usr / share / doc / redhat-release - * / RPM-GPG-KEY official use of the software upgrade. Note: Some time will be difficult to live in this gpgkey, and therefore can not continue. So, if it can not handle, or feel trouble, you can directly into gpgcheck 0 to cancel gpg verification, but this is unsafe. Test # yum update Loaded plugins: rhnplugin, security This system is not registered with RHN RHN support will be disabled..

Reproduced in: https: //my.oschina.net/766/blog/210875

Guess you like

Origin blog.csdn.net/weixin_34060299/article/details/91546228