Where Does Virtualmin Store Distro-Specific Repos?

It seems to me, having diddled with it for a while, that the most important part of making Virtualmin install / run on Oracle Linux (and presumably Rocky, Alma, and other CentOS 8 clones) will consist of pointing it to the right repos.

Is there some master config file that tells Webmin / Virtualmin where all the distro-specific repos are located?

Richard

Virtualmin doesn’t have anything do with the repos. We’re always using the system package manager.

On yum/dnf-based distros, it is always in /etc/yum.repos.d, and our repos are configured in a package called virtualmin-release (which sets up the key and configuration).

Where things get tricky with new distros (even when those distros are allegedly compatible with RHEL/CentOS) is that setting up EPEL and/or SCL may be different on different repos. And, we may not detect the OS appropriately to choose the right virtualmin-release package or setup the right EPEL and SCL repos. All of that is done in install.sh and OS detection is in the os_detect function in slib.sh. And, if any packages are missing in the new distro, it may be a problem.

Okay, thanks.

I’m poking around install.sh now. I’m wondering if Oracle’s CodeReady Builder repo will work as a drop-in for RH’s during the install routine if Oracle can be distinguished from RHEL (which it can if it cats /etc/os-release).

Just playing around for now on my local server. None of this is on a production box. I’m basically trying to correct each problem one at a time and work them into the shell script as they’re fixed. If I come up with something that actually seems to work, I’ll have one of you look it over.

Richard

Okay, so I think here is where I have to do the detection (in slib.h):

# Make sure we're Linux
  if echo "$os" | grep -iq linux; then
    if [ -f /etc/redhat-release ]; then # RHEL/CentOS
      local os_string
      os_string=$(cat /etc/redhat-release)
      isrhel=$(echo "$os_string" | grep 'Red Hat')
      if [ ! -z "$isrhel" ]; then
        os_real='RHEL'
      else
        os_real=$(echo "$os_string" | cut -d' ' -f1) # Doesn't work for Scientific
      fi
      os_type=$(echo "$os_real" | tr '[:upper:]' '[:lower:]')
      os_version=$(echo "$os_string" | grep -o '[0-9\.]*')
      os_major_version=$(echo "$os_version" | cut -d '.' -f1)
    elif [ -f /etc/os-release ]; then # Debian/Ubuntu
      # Source it, so we can check VERSION_ID
      # shellcheck disable=SC1091
      . /etc/os-release
      # Not technically correct, but os-release does not have 7.xxx for centos
      # shellcheck disable=SC2153
      os_real=$NAME
      os_type=$ID
      os_version=$VERSION_ID
      os_major_version=$(echo "${os_version}" | cut -d'.' -f1)
    else
      printf "${RED}No /etc/*-release file found, this OS is probably not supported.${NORMAL}\\n"
      return 1
    fi

Right now, once it decides it’s RHEL, it doesn’t check /etc/os-release. It needs to identify Oracle so it pulls from Oracle’s CodeReady Builder repo rather than RH’s subscription repo.

Richard

If you’re comfortable making a PR I’m happy to merge it (though me or Ilia will need to review it to make sure it doesn’t break any other supported repos…it’s a fragile bit of logic and it’s pretty important it works correctly across all supported distros or we’ll get wacky bug reports…incorrectly detected OS leads to all sorts of mischief). If not, if you post the contents of both /etc/redhat-release and /etc/os-release, I can try to find time to make it Oracle Linux aware.

1 Like

Hey, the more, the merrier. We need to get ready for this, so now’s as good a time as any to start.

/etc/redhat-release:

Red Hat Enterprise Linux release 8.3 (Ootpa)

/etc/os-release:

NAME="Oracle Linux Server"
VERSION="8.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.3

Richard

Oracle Linux 8 repos:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.