Linux, how to configure yum local sources and external network sources

Local source configuration: for example to an optical disc in rpm (herein Demo Virtual Machine)

1, a mirror mount of iso

Mount the CD-ROM to a directory, then go to the next /etc/yum.reps.d/ directory, create a file ending in .repo, as follows :( This file is in the best shorthand)

YUM: Yellowdog Update Modifier, rpm of the front-end program, resolves related dependent packages, may be positioned between a plurality of library package, the up2date alternative tool

yum repository: yum repo, many stores rpm package, and packets associated metadata
file (placed in a specific directory repodata)
file server:
HTTP: //
HTTPS: //
the FTP: //
File: //
yum configuration file content format is as follows:
 yum client configuration file:
/etc/yum.conf: All warehouse provides a common configuration directory to
provide configured to point to the warehouse: /etc/yum.repos.d/*.repo
define warehouse pointed to:
[RepositoryID]
name = name for the this Repository s Some
BaseURL = URL: // path / to / Repository /
Enabled. 1 = {| 0}      
gpgcheck. 1 = {| 0}
gpgkey the URL =
enablegroups. 1 = {| 0}
failovermethod of the RoundRobin = { | priority}
the RoundRobin: meaning randomly selected, the default value of
priority: in order to access
cost = defaults to 1000

After the configuration using the command immediately and yum repolist yum clean all the metadata can be used to generate local source

Source external network configuration:

 NetEase (163) yum source is one of the best sources of yum, both speed and software versions, are very good, the yum source to 163yum, can improve the speed of installation and update packages, while avoiding some of the common software version can not be found. Setting is as follows:

1, first enter the yum source configuration directory
cd /etc/yum.repos.d/ default yum source will be with an official, because these are foreign source address when the download speed will be much slower, to replace it with the following 163 source

2, the system comes back up source yum
mv * .repo repo_backup /

3, the current command execution directory surface, download source 163 yum NetEase:

After there will be a next to repo ending 163yum source configuration file, you can use directly

From the impact of prior source, first empty the cache about the record of yum,

yum yum clean all empty the cache

yum yum repolist view of the source list automatically download some soldiers metadata stored locally

4. Once you've configured you can use the yum install + Software name

 5, in addition to NetEase, there are other good yum domestic sources, such as USTC and Sohu, we can according to their needs download

USTC

wget http://centos.ustc.edu.cn/CentOS-Base.repo (do not know why, at present it seems can not be used)

Ali Cloud

wget http://mirrors.aliyun.com/repo/Centos-7.repo

sohu source of yum
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

The above examples demonstrate hope can help to you.

 

Guess you like

Origin www.linuxidc.com/Linux/2019-06/158907.htm
Recommended