Linux - yum源仓库配置

2021/5/17 7:27:52

本文主要是介绍Linux - yum源仓库配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 1 [14:24:53 root@centos8 ~]#yum -y install httpd;systemctl enable --now httpd
 2 
 3 [14:50:18 root@centos8 ~]#mkdir /var/www/html/centos/{7,8} -pv
 4 mkdir: created directory '/var/www/html/centos'
 5 mkdir: created directory '/var/www/html/centos/7'
 6 mkdir: created directory '/var/www/html/centos/8'
 7 [14:50:21 root@centos8 ~]#mount /data/os_images/CentOS-7-x86_64-DVD-2009.iso /var/www/html/centos/7
 8 mount: /var/www/html/centos/7: WARNING: device write-protected, mounted read-only.
 9 [14:50:50 root@centos8 ~]#mount /data/os_images/CentOS-8.3.2011-x86_64-dvd1.iso /var/www/html/centos/8
10 mount: /var/www/html/centos/8: WARNING: device write-protected, mounted read-only.
11 
12 这个时候访问http://10.0.0.3/centos/就可以得到挂载的源
13 
14 同理,extras源也类似
15 [17:30:18 root@centos8 ~]#mkdir /var/www/html/extras
16 [17:31:02 root@centos8 ~]#yum reposync --repoid=extras --download-metadata -p /var/www/html/extras
17 
18 [17:31:28 root@centos8 ~]#ll /var/www/html/extras
19 total 0
20 drwxr-xr-x. 4 root root 38 May 16 17:31 extras
21 [17:32:28 root@centos8 ~]#ll /var/www/html/extras/extras/
22 total 8
23 drwxr-xr-x. 2 root root 4096 May 16 17:31 Packages
24 drwxr-xr-x. 2 root root 4096 May 16 17:31 repodata
25 
26 [17:34:26 root@centos8 ~]#mv /var/www/html/extras/extras /var/www/html/extras/extras_8
27 
28 测试extras是否成功
29 [17:45:52 root@centos8 data]#yum clean all
30 38 files removed
31 [17:45:57 root@centos8 data]#yum list --disablerepo=* --enablerepo=extras
32 
33 centos-release-qpid-proton.noarch                                                 1-2.el8                                                                   extras    
34 centos-release-rabbitmq-38.noarch                                                 1-2.el8                                                                   extras    
35 centos-release-samba411.noarch                                                    1.0-1.el8                                                                 extras    
36 centos-release-samba412.noarch                                                    1.0-1.el8                                                                 extras    
37 centos-release-samba413.noarch                                                    1.0-1.el8                                                                 extras    
38 centos-release-samba414.noarch                                                    1.0-1.el8                                                                 extras    
39 centos-release-storage-common.noarch                                              2-2.el8                                                                   extras    
40 centos-release-stream.x86_64                                                      8.1-1.1911.0.7.el8                                                        extras    
41 centos-release-virt-common.noarch                                                 1-2.el8                                                                   extras    
42 centos-stream-repos.noarch                                                        8-2.el8                                                                   extras    
43 cpaste.x86_64                                                                     1.0.0-3.el8                                                               extras   
44 
45 
46 [17:46:26 root@centos8 data]#yum -y install cpaste.x86_64  
47 Last metadata expiration check: 0:00:32 ago on Sun 16 May 2021 05:46:26 PM CST.
48 Dependencies resolved.
49 ======================================================================================================================================================================
50  Package                               Architecture                          Version                                      Repository                             Size
51 ======================================================================================================================================================================
52 Installing:
53  cpaste                                x86_64                                1.0.0-3.el8                                  extras                                 42 k
54 
55 Transaction Summary
56 ======================================================================================================================================================================
57 Install  1 Package
58 
59 Total download size: 42 k
60 Installed size: 107 k
61 Downloading Packages:
62 cpaste-1.0.0-3.el8.x86_64.rpm                                                                                                          27 MB/s |  42 kB     00:00    
63 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
64 Total                                                                                                                                 4.1 MB/s |  42 kB     00:00     
65 Running transaction check
66 Transaction check succeeded.
67 Running transaction test
68 Transaction test succeeded.
69 Running transaction
70   Preparing        :                                                                                                                                              1/1 
71   Installing       : cpaste-1.0.0-3.el8.x86_64                                                                                                                    1/1 
72   Running scriptlet: cpaste-1.0.0-3.el8.x86_64                                                                                                                    1/1 
73   Verifying        : cpaste-1.0.0-3.el8.x86_64                                                                                                                    1/1 
74 
75 Installed:
76   cpaste-1.0.0-3.el8.x86_64                                                                                                                                           
77 
78 Complete!

 



这篇关于Linux - yum源仓库配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程