Here is an example using “ffmpeg” as the package to download. I have tested the process on both Red Hat and CentOS 6.?

Install all the required package for the download process.

# yum install yum-plugin-downloadonly yum-utils createrepo
# mkdir /var/tmp/ffmpeg
# mkdir /var/tmp/ffmpeg-installroot

Note: The installroot is for the metada that will allow the full download of all dependencies.
# yum install --downloadonly --installroot=/var/tmp/ffmpeg-installroot --releasever=6 --downloaddir=/var/tmp/ffmpeg ffmpeg
Now, Generate the metadata needed to turn our new pile of RPMs into a YUM repo.

# createrepo --database /var/tmp/ffmpeg
# rm -rf /var/tmp/ffmpeg-installroot Configure the repo:
# vi /etc/yum.repos.d/offline-ffmpeg.repo
[offline-ffmpeg]
name=CentOS-$releasever - ffmpeg
baseurl=file:///var/tmp/ffmpeg
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

To check the missing dependencies:
# repoclosure --repoid=offline-ffmpeg

Then Offline: 

# yum --disablerepo=\* --enablerepo=offline-ffmpeg install ffmpeg

Good luck!!
 

Leave a Reply

Your email address will not be published. Required fields are marked *