Skip to content

Instantly share code, notes, and snippets.

@nutrino
Created January 8, 2025 10:59
Show Gist options
  • Select an option

  • Save nutrino/74bb7fbe1ef9a7d864a8c1876a3115d5 to your computer and use it in GitHub Desktop.

Select an option

Save nutrino/74bb7fbe1ef9a7d864a8c1876a3115d5 to your computer and use it in GitHub Desktop.

Revisions

  1. nutrino created this gist Jan 8, 2025.
    15 changes: 15 additions & 0 deletions yumdown_86.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/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