赞
踩
YUM源拉取服务器(外网):银河麒麟服务器操作系统V10SP2-x86_64
YUM源服务端(内网):银河麒麟服务器操作系统V10SP1-aarch64
YUM源客户端(内网):银河麒麟服务器操作系统V10SP1(20210518)-aarch64
[root@localhost ~]# yum install -y createrepo
[root@localhost ~]# touch /etc/yum.repos.d/kylin_V10SP1_aarch64.repo
[ks10-adv-os-aarch64]
name = Kylin V10SP1-20210518-aarch64 - Os
baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP1.1/os/adv/lic/base/aarch64/
gpgcheck = 0
enabled = 1
[ks10-adv-updates-aarch64]
name = Kylin V10SP1-20210518-aarch64 - Updates
baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP1.1/os/adv/lic/updates/aarch64/
gpgcheck = 0
enabled = 1
[root@localhost ~]# yum repolist
仓库标识 仓库名称
ks10-adv-os Kylin Linux Advanced Server 10 - Os
ks10-adv-os-aarch64 Kylin V10SP1-20210518-aarch64 - Os
ks10-adv-updates Kylin Linux Advanced Server 10 - Updates
ks10-adv-updates-aarch64 Kylin V10SP1-20210518-aarch64 - Updates
[root@localhost ~]# mkdir -p /data/repo
[root@localhost ~]# reposync --repoid ks10-adv-os-aarch64 --repoid ks10-adv-updates-aarch64 -p /data/repo/ Kylin V10SP1-20210518-aarch64 - Os 1.3 MB/s | 11 MB 00:08 Kylin V10SP1-20210518-aarch64 - Updates 1.5 MB/s | 9.0 MB 00:06 上次元数据过期检查:0:00:08 前,执行于 2022年12月06日 星期二 16时03分50秒。 (1/13095): CUnit-help-2.1.3-21.ky10.noarch.rpm 53 kB/s | 15 kB 00:00 (2/13095): CUnit-devel-2.1.3-21.ky10.aarch64.rpm 169 kB/s | 54 kB 00:00 (3/13095): CUnit-2.1.3-21.ky10.aarch64.rpm 149 kB/s | 49 kB 00:00 (4/13095): DevIL-ILUT-1.7.8-31.oe1.aarch64.rpm 307 kB/s | 20 kB 00:00 (5/13095): DevIL-ILUT-devel-1.7.8-31.oe1.aarch64.rpm 238 kB/s | 14 kB 00:00 (6/13095): DevIL-1.7.8-31.oe1.aarch64.rpm 1.8 MB/s | 214 kB 00:00 (7/13095): DevIL-devel-1.7.8-31.oe1.aarch64.rpm 647 kB/s | 37 kB 00:00 (8/13095): DevIL-help-1.7.8-31.oe1.aarch64.rpm 671 kB/s | 38 kB 00:00 (9/13095): GConf2-devel-3.2.6-24.ky10.aarch64.rpm 1.4 MB/s | 94 kB 00:00 (10/13095): GeoIP-1.6.12-5.ky10.aarch64.rpm 1.1 MB/s | 111 kB 00:00 (11/13095): GeoIP-devel-1.6.12-5.ky10.aarch64.rpm 140 kB/s | 12 kB 00:00 (12/13095): GConf2-3.2.6-24.ky10.aarch64.rpm 4.0 MB/s | 990 kB 00:00 (13/13095): GeoIP-help-1.6.12-5.ky10.noarch.rpm 114 kB/s | 8.7 kB 00:00 (14/13095): GraphicsMagick-c++-1.3.30-6.ky10.aarch64.rpm 649 kB/s | 107 kB 00:00 (15/13095): GraphicsMagick-1.3.30-6.ky10.aarch64.rpm 5.5 MB/s | 1.2 MB 00:00 (16/13095): GraphicsMagick-c++-devel-1.3.30-6.ky10.aarch64.rpm 710 kB/s | 52 kB 00:00 (17/13095): GraphicsMagick-devel-1.3.30-6.ky10.aarch64.rpm 995 kB/s | 74 kB 00:00 (18/13095): GraphicsMagick-perl-1.3.30-6.ky10.aarch64.rpm 1.6 MB/s | 164 kB 00:00 (19/13095): GraphicsMagick-help-1.3.30-6.ky10.noarch.rpm 1.8 MB/s | 1.1 MB 00:00 (20/13095): ImageMagick-6.9.10.67-6.1.ky10.aarch64.rpm 3.8 MB/s | 2.0 MB 00:00 (21/13095): ImageMagick-c++-devel-6.9.10.67-6.1.ky10.aarch64.rpm 1.1 MB/s | 89 kB 00:00 (22/13095): ImageMagick-c++-6.9.10.67-6.1.ky10.aarch64.rpm 1.4 MB/s | 148 kB 00:00 (23/13095): ImageMagick-devel-6.9.10.67-6.1.ky10.aarch64.rpm 1.4 MB/s | 90 kB 00:00
[root@localhost ks10-adv-os-aarch64]# createrepo -o /data/repo/ks10-adv-os-aarch64/ -v /data/repo/ks10-adv-os-aarch64/Packages/
[root@localhost ks10-adv-os-aarch64]# createrepo -o /data/repo/ks10-adv-updates-aarch64/ -v /data/repo/ks10-adv-updates-aarch64/Packages/
[root@localhost data]# pwd
/data
[root@localhost data]# tar -zcvf repo.tar.gz repo
[root@localhost data]# pwd
/data
[root@localhost data]# tar -zxvf repo.tar.gz
[root@localhost yum.repos.d]# vim /etc/yum.repos.d/kylin_aarch64.repo
[ks10-baseOS]
name = Kylin V10SP1-20210518-aarch64 - Os
baseurl = file:///data/repo/ks10-adv-os-aarch64/
gpgcheck = 0
enabled = 1
[ks10-Updates]
name = Kylin V10SP1-20210518-aarch64 - Updates
baseurl = file:///data/repo/ks10-adv-updates-aarch64/
gpgcheck = 0
enabled = 1
[root@localhost ~]# yum install -y httpd
(1)其中192.168.42.171为“YUM源服务端”的IP地址。
[root@localhost ~]# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/repo.conf
<VirtualHost *:80>
Servername 192.168.42.171
DocumentRoot /data/repo
<Directory /data/repo>
Require all granted
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
(2)重启httpd服务并设置开机自启;
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]#
(3)浏览器中访问http://192.168.42.171;
[root@localhost]# mv /etc/yum.repos.d/kylin_aarch64.repo /etc/yum.repos.d/kylin_aarch64.repo.bak
[root@localhost ~]# vim /etc/yum.repos.d/kylin_aarch64.repo
[ks10-adv-os-aarch64]
name = Kylin V10SP1-20210518-aarch64 - Os
baseurl = http://192.168.42.171/ks10-adv-os-aarch64/
gpgcheck = 0
enabled = 1
[ks10-adv-updates-aarch64]
name = Kylin V10SP1-20210518-aarch64 - Updates
baseurl = http://192.168.42.171/ks10-adv-updates-aarch64/
gpgcheck = 0
enabled = 1
[root@localhost ~]# yum clean all
11 文件已删除
[root@localhost ~]# yum makecache
Kylin V10SP1-20210518-aarch64 - Os 16 MB/s | 24 kB 00:00
Kylin V10SP1-20210518-aarch64 - Updates 6.4 MB/s | 13 kB 00:00
元数据缓存已建立。
[root@localhost ~]# yum repolist
仓库标识 仓库名称
ks10-adv-os-aarch64 Kylin V10SP1-20210518-aarch64 - Os
ks10-adv-updates-aarch64 Kylin V10SP1-20210518-aarch64 - Updates
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。