Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  DNF: Unable to detect release version

    Posted Tue March 22, 2022 03:12 AM
    Dear Team,

    on some of our systems I see the following message when using dnf:

    "Unable to detect release version (use '--releasever' to specify release version)"

    Just want to know, is that a config issue? We are using the same config over all of our systems, but seeing this message only on a few...

    best regards,
    Joerg

    ------------------------------
    Joerg Kauke
    Unix Administrator
    COOP Switzerland
    ------------------------------

    #AIXOpenSource


  • 2.  RE: DNF: Unable to detect release version

    Posted Wed March 23, 2022 11:09 AM

    Joerg,

    The file that provides releasever is created during dnf-data install.  I think it would be easiest to run the commands that create it:

    # Create releasever variable fils in /opt/freeware/etc/dnf/vars path
    # This is to avoid Unable to detect release version warning
    release_ver=`/usr/bin/lslpp -qLc bos.rte | /usr/bin/cut -d: -f3`
    touch /opt/freeware/etc/dnf/vars/releasever
    echo $release_ver > /opt/freeware/etc/dnf/vars/releasever




    Or if you reinstall the rpm (may need to download the tarball if dnf-data not in repo), the below rpm scripting will come into play:

    rpm --scripts -qp dnf-data-4.2.17-32_1.aix7.1.noarch.rpm 
    preinstall scriptlet (using /bin/sh):
    rpm -qa | /usr/bin/grep "^dnf-data-4.2.17-1"  >/dev/null 2>&1
    if [[ $? -eq 0 ]]
    then
        echo "dnf-data-4.2.17-1 and dnf-data-4.2.17-32_1 are same."
        exit 1
    fi
    postinstall scriptlet (using /bin/sh):
    if [[ "$1" = "1" ]]
    then
        # Create releasever variable fils in /opt/freeware/etc/dnf/vars path
        # This is to avoid Unable to detect release version warning
        release_ver=`/usr/bin/lslpp -qLc bos.rte | /usr/bin/cut -d: -f3`
        touch /opt/freeware/etc/dnf/vars/releasever
        echo $release_ver > /opt/freeware/etc/dnf/vars/releasever
    
        osver=`/usr/bin/oslevel`
        dnf_conf=`ls /opt/freeware/etc/dnf/dnf.conf`
        if [[ $osver = "7.1.0.0" ]]
        then
            /usr/bin/echo "[AIX_Toolbox_71]" >> $dnf_conf
            /usr/bin/echo "name=AIX 7.1 specific repository" >> $dnf_conf
            /usr/bin/echo "baseurl=https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/" >> $dnf_conf
            /usr/bin/echo "enabled=1" >> $dnf_conf
            /usr/bin/echo "gpgcheck=0" >> $dnf_conf
            /usr/bin/echo "" >> $dnf_conf
        elif [[ $osver = "7.2.0.0" ]]
        then
            /usr/bin/echo "[AIX_Toolbox_72]" >> $dnf_conf
            /usr/bin/echo "name=AIX 7.2 specific repository" >> $dnf_conf
            /usr/bin/echo "baseurl=https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/" >> $dnf_conf
            /usr/bin/echo "enabled=1" >> $dnf_conf
            /usr/bin/echo "gpgcheck=0" >> $dnf_conf
            /usr/bin/echo "" >> $dnf_conf
        else
            echo "No additional repositories were added"
        fi
    fi


    Best of luck!



    ------------------------------
    Cory Beverlin
    ------------------------------



  • 3.  RE: DNF: Unable to detect release version

    Posted Thu March 24, 2022 04:54 AM
    Thanks Cory...

    it worked well, no warnings anymore. Many thanks for your support.

    I assume I have to do it again after upgrading the OS to TL5 or AIX 7.3...???

    Best regards,

    ------------------------------
    Joerg Kauke
    Unix Administrator
    COOP Switzerland
    ------------------------------



  • 4.  RE: DNF: Unable to detect release version

    Posted Thu March 24, 2022 09:41 AM
    Joerg,

    Thanks for the update and you're welcome.

    TL updates - I don't know.  I would hope that IBM has a mechanism in place to keep it current, but I won't know until our next round of patching in the upcoming months.  But, I'm not even sure if the releasever is in use (yet).

    AIX 7.3 migration - Again, best to check after taking the post-migration steps in Sangamesh's blog article.  I'm not sure when I'll get to test this.
    https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2022/01/10/aix-migration-with-dnf

    Warm Regards,

    ------------------------------
    Cory Beverlin
    ------------------------------