Centos Yum Install Download Only for Offline Install

 yum install yum-plugin-downloadonly yum-utils createrepo

mkdir /var/tmp/httpd
mkdir /var/tmp/httpd-installroot

yum install --downloadonly --installroot=/var/tmp/httpd-installroot --releasever=7 --downloaddir=/var/tmp/httpd httpd

createrepo --database /var/tmp/httpd

vi /etc/yum.repos.d/offline-httpd.repo

[offline-httpd]
name=CentOS-$releasever - httpd
baseurl=file:///var/tmp/httpd
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

repoclosure --repoid=offline-httpd


0 comments:

Post a Comment