当前位置:   article > 正文

银河麒麟服务器操作系统V10搭建内网YUM源服务器_麒麟系统安装yum

麒麟系统安装yum

系统环境

YUM源拉取服务器(外网):银河麒麟服务器操作系统V10SP2-x86_64
YUM源服务端(内网):银河麒麟服务器操作系统V10SP1-aarch64
YUM源客户端(内网):银河麒麟服务器操作系统V10SP1(20210518)-aarch64在这里插入图片描述

YUM源拉取服务器(外网)配置

安装createrepo组件

[root@localhost ~]# yum install -y createrepo
  • 1

添加repo仓库

  1. 在目录/etc/.yum.repos.d/目录下创建repo文件
[root@localhost ~]# touch /etc/yum.repos.d/kylin_V10SP1_aarch64.repo
  • 1
  1. 修改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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  1. 查看当前的repo仓库列表
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

拉取repo数据

  1. 创建/data/repo目录用于存放拉取的官方repo仓库数据;
[root@localhost ~]# mkdir -p /data/repo
  • 1
  1. 从银河麒麟官方yum源同步repo仓库数据到本地/data/repo目录;
    备注:我们这里使用repoid参数指定同步仓库为ks10-adv-os-aarch64ks10-adv-updates-aarch64
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  1. 为repo仓库数据生成对应的repodata元数据;
[root@localhost ks10-adv-os-aarch64]# createrepo -o /data/repo/ks10-adv-os-aarch64/ -v /data/repo/ks10-adv-os-aarch64/Packages/
  • 1
[root@localhost ks10-adv-os-aarch64]# createrepo -o /data/repo/ks10-adv-updates-aarch64/ -v /data/repo/ks10-adv-updates-aarch64/Packages/
  • 1
  1. 将上述步骤中拉取的repo仓库数据文件打包后导出到移动存储介质,用于后续导入到“YUM源服务端(内网)”;
[root@localhost data]# pwd
/data
[root@localhost data]# tar -zcvf repo.tar.gz repo
  • 1
  • 2
  • 3

YUM源服务端(内网)配置

  1. 将上述生成的repo仓库数据压缩包repo.tar.gz导入到服务器中,并解压;
[root@localhost data]# pwd
/data
[root@localhost data]# tar -zxvf repo.tar.gz
  • 1
  • 2
  • 3
  1. 修改服务器yum源配置文件/etc/yum.repos.d/kylin_aarch64.repo;
[root@localhost yum.repos.d]# vim /etc/yum.repos.d/kylin_aarch64.repo
  • 1
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  1. 安装httpd服务用于发布yum源;
[root@localhost ~]# yum install -y httpd
  • 1
  1. 配置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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

(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 ~]#
  • 1
  • 2
  • 3
  • 4

(3)浏览器中访问http://192.168.42.171;
在这里插入图片描述

YUM源客户端(内网)配置

  1. 修改客户端服务器系统的/etc/yum.repos.d/kylin_aarch64.repo配置文件,如下:
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  1. 执行以下命令生成repo仓库列表缓存;
[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/216928
推荐阅读
相关标签
  

闽ICP备14008679号