Created
January 8, 2025 10:59
-
-
Save nutrino/74bb7fbe1ef9a7d864a8c1876a3115d5 to your computer and use it in GitHub Desktop.
yum (dnf) downloader for offline installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x #echo on | |
PKG=$1 # NAME OF THE PACKAGE TO INSTALL ON OFFLINE MACHINE | |
rm /tmp/modules-$PKG.yaml | |
rm -rf /tmp/$PKG | |
rm -rf /tmp/$PKG-installroot | |
mkdir /tmp/$PKG | |
mkdir /tmp/$PKG-installroot | |
yum install -y --downloadonly --installroot=/tmp/$PKG-installroot --releasever=8.6 --downloaddir=/tmp/$PKG $PKG | |
createrepo -q --database /tmp/$PKG | |
repo2module --debug --module-name=$PKG --module-stream=stable /tmp/$PKG /tmp/modules-$PKG.yaml | |
modifyrepo_c --mdtype=modules /tmp/modules-$PKG.yaml /tmp/$PKG/repodata | |
rm -rf /tmp/$PKG-installroot | |
tar -cvzf $PKG.tar.gz /tmp/$PKG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment