Skip to content

Instantly share code, notes, and snippets.

@jmpolom
Created October 20, 2021 01:11
Show Gist options
  • Save jmpolom/793abb523c10e9df9cb46c1ba63de4d5 to your computer and use it in GitHub Desktop.
Save jmpolom/793abb523c10e9df9cb46c1ba63de4d5 to your computer and use it in GitHub Desktop.
To assemble fedora kernel package location
#!/bin/bash
#KERNEL_VERSION=$(uname -r)
KERNEL_VERSION="5.13.3-200.fc34.x86_64"
KERNEL_RPM_VERSION=${KERNEL_VERSION%-*}
echo $KERNEL_RPM_VERSION
KERNEL_RPM_RELEASE=${KERNEL_VERSION%.*}
echo $KERNEL_RPM_RELEASE
KERNEL_RPM_RELEASE=${KERNEL_RPM_RELEASE#*-}
echo $KERNEL_RPM_RELEASE
KERNEL_RPM_ARCH=${KERNEL_VERSION##*.}
echo $KERNEL_RPM_ARCH
KOJI_BASE="http://kojipkgs.fedoraproject.org/packages"
KOJI_URL=$KOJI_BASE/kernel/$KERNEL_RPM_VERSION/$KERNEL_RPM_RELEASE/$KERNEL_RPM_ARCH/kernel-devel-$KERNEL_VERSION.rpm
echo $KOJI_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment