Centos8创建局域网的私有yum源

2022/3/7 7:20:25

本文主要是介绍Centos8创建局域网的私有yum源,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

仓库服务器配置
[root@centos8-hkping ~]#yum -y install httpd
[root@centos8-hkping ~]#systemctl enable --now httpd
[root@centos8-hkping ~]#mkdir /var/www/html/centos/8 -pv
[root@centos8-hkping ~]#mount /dev/sr0 /mnt/
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@centos8-hkping ~]#cp -a /mnt/* /var/www/html/centos/8

 

下载阿里云的extras源,制作私有yum源
[root@repo-server ~]#dnf reposync --repoid=extras --download-metadata -p/var/www/html/centos 
[root@repo-server ~]#ls /var/www/html/centos/extras/ Packages repodata

下载阿里云的EPEL源,制作私有yum源

#下载相关仓库包和元数据
[root@centos8 ~]#dnf reposync --repoid=epel --download-metadata   -p/var/www/html
#下载相关的key文件
[root@repo-server ~]#wget -P /var/www/html/epel/https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8
[root@centos8 ~]#ls /var/www/html/epel/
Packages repodata

yum客户端配置

[root@centos8-hkping /]#vim /etc/yum.repos.d/test.repo
[BaseOS]
name=BaseOS
baseurl=http://10.0.0.155/centos/8/BaseOS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=Appstream
baseurl=http://10.0.0.155/centos/8/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=extras
baseurl=http://10.0.0.155/centos/extras/
[epel]
name=epelbaseurl=http://10.0.0.155/epel/
gpgkey=http://10.0.0.8/epel/RPM-GPG-KEY-EPEL-8
[root@centos8-hkping /]#yum clean all && yum makecache
[root@centos8-hkping /]#yum repolist
仓库服务器配置 [root@centos8-hkping ~]#yum -y install httpd [root@centos8-hkping ~]#systemctl enable --now httpd [root@centos8-hkping ~]#mkdir /var/www/html/centos/8 -pv [root@centos8-hkping ~]#mount /dev/sr0 /mnt/ mount: /mnt: WARNING: device write-protected, mounted read-only. [root@centos8-hkping ~]#cp -a /mnt/* /var/www/html/centos/8 下载阿里云的extras源,制作私有yum源 [root@repo-server ~]#dnf reposync --repoid=extras --download-metadata -p/var/www/html/centos [root@repo-server ~]#ls /var/www/html/centos/extras/ Packages repodata 下载阿里云的EPEL源,制作私有yum源 #下载相关仓库包和元数据 [root@centos8 ~]#dnf reposync --repoid=epel --download-metadata   -p/var/www/html #下载相关的key文件 [root@repo-server ~]#wget -P /var/www/html/epel/https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 [root@centos8 ~]#ls /var/www/html/epel/ Packages repodata yum客户端配置 [root@centos8-hkping /]#vim /etc/yum.repos.d/test.repo [BaseOS] name=BaseOS baseurl=http://10.0.0.155/centos/8/BaseOS gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [AppStream] name=Appstream baseurl=http://10.0.0.155/centos/8/AppStream/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [extras] name=extras baseurl=http://10.0.0.155/centos/extras/ [epel] name=epelbaseurl=http://10.0.0.155/epel/ gpgkey=http://10.0.0.8/epel/RPM-GPG-KEY-EPEL-8 [root@centos8-hkping /]#yum clean all && yum makecache [root@centos8-hkping /]#yum repolist  

 



这篇关于Centos8创建局域网的私有yum源的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程