YUM repository (local yum, online yum)

[the root @ localhost ~] # umount / Media / 
umount: / Media /: unmounted 
[the root @ localhost ~] # Mount / dev / SR0 / Media / 
Mount: / dev / write protection SR0, hanging as read-only carrier 
[the root @ localhost ~] # DF 
/ dev / SR0 4480476 4480476 0 100% / Media 
[the root @ localhost ~] # CD /etc/yum.repos.d/ 
[yum.repos.d the root @ localhost] # mkdir / cdrom 
[root @ localhost yum.repos.d] # mv * C / cdrom /

  [root@localhost yum.repos.d]# vim local.repo

[KGC] 
name = KGC 
baseurl = file: /// media 
enabled = 1 
gpgcheck = 0
[root @ localhost yum.repos.d] # yum -y clean all // clear the yum repository 
is loaded plugins: fastestmirror, langpacks 
are cleaning software source: KGC 
Cleaning up List of Fastest Mirrors 
Other Repos 450 M of the Take up Disk Space ( --verbose the Details for use) 
[root @ localhost yum.repos.d] # yum makecache // rebuild metadata cache 
is loaded plugins: fastestmirror, the Langpacks 
Determining Fastest Mirrors 
KGC | 3.6 kB 00:00:00 
(1/4) : KGC / group_gz | 166 kB 00:00:00 
(2/4): KGC / filelists_db | 3.2 MB 00:00:00 
(3/4): KGC / primary_db | 3.1 MB 00:00:00 
(4/4 ): kgc / other_db | 1.3 MB 00:00:00 
metadata cache has been established
Copy the code

Online yum :( Ali mirrored boot download, configure epel yum source)

Copy the code
 
 

[root@localhost ~]# vim 163.repo

[163]
name=163
baseurl=http://mirrors.163.com/centos/7.6.1810/os/x86_64/
gpgcheck=0
enabled=1
[root @ localhost ~] # cd /etc/yum.repos.d/ 
[root @ localhost yum.repos.d] // wget # wget is http://mirrors.aliyun.com/repo/Centos-7.repo a tool to download files 
--2019-09-09 09: 46: 47-- http://mirrors.aliyun.com/repo/Centos-7.repo 
Resolving host mirrors.aliyun.com (mirrors.aliyun.com ) ... 219.238.20.83, 219.238.20.85, 219.238.20.101, ... 
connecting mirrors.aliyun.com (mirrors.aliyun.com) | 219.238.20.83 |: 80 ... failed: connection refused. 
Connecting mirrors.aliyun.com (mirrors.aliyun.com) | 219.238.20.85 |: 80 ... connected. 
HTTP request has been issued, awaiting response ... 200 OK 
length: 2523 (2.5K) [application / octet-stream] 
is saved to: "Centos-7.repo" 

100% [========= ================================================== ====================>] 2,523 11.2KB / s when using 0.2s   

2019-09-09 09:47:09 (11.2 KB / s) - Saved "Centos-7.repo" [2523/2523]) 

[root @ localhost yum.repos.d] #

Guess you like

Origin www.cnblogs.com/L1-5551/p/11518438.html
yum