生產環境須要大規模的安裝部署rpm包,每次安裝,更新,都須要上傳,安裝,比較麻煩,能夠在生產環境中自建一個yum源。html
1、http安裝vim
yum -y install httpd緩存
systemctl start httpd.service測試
systemctl enable httpd.serviceurl
2、createrepo安裝spa
yum -y install createrepocdn
3、建立repodata目錄htm
cd /var/www/html/部署
mkdir pacdn_yum/x86_64 -ptest
createrepo pacdn_yum/x86_64
4、把須要發佈的安裝包存放到repodata目錄
cp ./*.rpm /var/www/html/ pacdn_yum/x86_64
5、更新發布yum源,因爲有新增rpm包須要
createrepo --update pacdn_yum/x86_64
#更新本地源
6、客戶端設備上增長repo源文件
cd /etc/yum.repos.d
vim pacdn_yum.repo
[pacdn_yum]
name= pacdn_yum
baseurl=http://192.168.2.92/pacdn_yum/x86_64
gpgcheck=0
7、測試是否生效
先清除客戶端本地yum數據源緩存,在進行安裝
yum clean all
yum install test.rpm