def __distro(self):
        """Based on the Linux distribution, set values accordingly.  A user
           specified value overrides any defaults."""

        # packaging.version.Version cannot handle version strings like
        # 5.0-1.2.3.4.  Only the part before the dash is needed, so
        # get the first half.
        version_nodash = self.__version
        if '-' in self.__version:
            version_nodash = self.__version.split('-')[0]

        if hpccm.config.g_linux_distro == linux_distro.UBUNTU:
            self.__deppackages = ['libnl-3-200', 'libnl-route-3-200',
                                 'libnuma1']

            if not self.__oslabel:
                if hpccm.config.g_linux_version >= Version('22.0'):
                    self.__oslabel = 'ubuntu22.04'
                elif hpccm.config.g_linux_version >= Version('20.0'):
                    self.__oslabel = 'ubuntu20.04'
                elif hpccm.config.g_linux_version >= Version('18.0'):
                    self.__oslabel = 'ubuntu18.04'
                else:
                    self.__oslabel = 'ubuntu16.04'

            if not self.__packages:
                if Version(version_nodash) >= Version('5.0'):
                    # Uses UPSTREAM libs
                    self.__packages = ['libibverbs1', 'libibverbs-dev',
                                       'ibverbs-providers', 'ibverbs-utils',
                                       'libibmad5',  'libibmad-dev',
                                       'libibumad3', 'libibumad-dev',
                                       'librdmacm-dev', 'librdmacm1']
                else:
                    # Uses MLNX_OFED libs
                    self.__packages = ['libibverbs1', 'libibverbs-dev',
                                       'ibverbs-utils',
                                       'libibmad',  'libibmad-devel',
                                       'libibumad', 'libibumad-devel',
                                       'libmlx4-1', 'libmlx4-dev',
                                       'libmlx5-1', 'libmlx5-dev',
                                       'librdmacm-dev', 'librdmacm1']

        elif hpccm.config.g_linux_distro == linux_distro.CENTOS:
            if hpccm.config.g_linux_version >= Version('8.0'):
                self.__deppackages = ['libnl3', 'numactl-libs']
            else:
                self.__deppackages = ['libnl', 'libnl3', 'numactl-libs']

            if not self.__oslabel:
                if hpccm.config.g_linux_version >= Version('8.0'):
                    self.__oslabel = 'rhel8.0'
                else:
                    if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
                        self.__oslabel = 'rhel7.6alternate'
                    else:
                        self.__oslabel = 'rhel7.2'

            if not self.__packages:
                if Version(version_nodash) >= Version('5.0'):
                    # Uses UPSTREAM libs
                    self.__packages = ['libibverbs', 'libibverbs-utils',
                                       'libibumad', 'librdmacm',
                                       'rdma-core', 'rdma-core-devel']
                else:
                    # Uses MLNX_OFED libs
                    self.__packages = ['libibverbs', 'libibverbs-devel',
                                       'libibverbs-utils',
                                       'libibmad', 'libibmad-devel',
                                       'libibumad', 'libibumad-devel',
                                       'libmlx4', 'libmlx4-devel',
                                       'libmlx5', 'libmlx5-devel',
                                       'librdmacm-devel', 'librdmacm']

        else: # pragma: no cover
            raise RuntimeError('Unknown Linux distribution')
Based on the Linux distribution, set values accordingly.  A user
           specified value overrides any defaults.
hpccm/building_blocks/mlnx_ofed.py