Air-gap installation of Foreman 2.1 on CentOS 8 fails on repository issues

I have tried to modify the CentOS 7 air-gap installation so that I can install for Foreman 2.1 on an air-gapped CentOS 8. I followed these steps:

  1. Created a working Foreman 2.1 on a vanilla CentOS 8 “connected” installation

  2. Using yum I downloaded all the repositories other than anaconda on the Foreman 2.1 VM (AppStream, BaseOS, epel, extras, foreman, puppet)

  3. Using the extra tools found in https://github.com/rpm-software-management/modulemd-tools rebuilt the repodata directory:

    # for i in AppStream BaseOS epel extras foreman puppet; do
    > cd $i
    > createrepo .
    > repo2module  -s stable -d . modules.yaml
    > modifyrepo_c --mdtype=modules modules.yaml repodata/
    > cd -
    > done;
    
  4. I then created a new vanilla CentOS 8 VM

  5. I exported the parent directory of the repositories (in my case /repos) and mounted them under /var/local/repos on the new VM

  6. I removed all the original *.repo files in /etc/yum.repos.d and created a new file called local.repo:

    [base]
    name=CentOS- - Base
    baseurl=file:///var/local/repos/BaseOS
    enabled=1
    gpgcheck=0
    
    [appstream]
    name=CentOS- - AppStream
    baseurl=file:///var/local/repos/AppStream
    enabled=1
    gpgcheck=0
    
    [epel]
    name=Extra Packages for Enterprise Linux 8 -
    baseurl=file:///var/local/repos/epel
    enabled=1
    gpgcheck=0
    
    [foreman]
    name=Foreman 2.1
    baseurl=file:///var/local/repos/foreman
    enabled=1
    gpgcheck=0
    
    [puppet]
    name=Puppet 6.17
    baseurl=file:///var/local/repos/puppet
    enabled=1
    
  7. Updated the file /etc/foreman-installer/scenarios.d/foreman-answers.yaml:

    foreman:
    custom_repo: true
    configure_epel_repo: false

  8. Updated the /etc/hosts file for the FQDN hostname of the VM

  9. Performed the following steps:

    # yum -y install foreman-installer
    # foreman-installer -v
    - installation fails
    

The first error from the log file is on /bin/dnf -d 0 -e 1 -y install foreman-postgresql claiming the dependency of rubygem-irb-1.0.0-106.module_el8.1.0+249+93480f15.noarch, etc.

I can share the complete log if it would help.

I also tried an interactive installation “foreman-installer -i” with the following errors:

- conflicting requests
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:490:in `set'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:570:in `sync'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:544:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:544:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:544:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:231:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:210:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

This package should be in the app stream repo, are you sure the repo has been cloned properly? You might need to enable some module (probably ruby) to make it available to the host.

I looked at. I built the repository based on what was installed for a valid Foreman 2.1 downloading all the appropriate RPMs. On the original Foreman 2.1 on CentOS 8 is run “rpm -qa | grep -i irb” and I get nothing.
I remind you that I modified the instructions under Method 2 in Installing Foreman in an air-gapped environment for “@AppStream” and “@BaseOS”.
Why does the new installation require it when the original installation didn’t?

Here are 2 logs - 1 interactive and 1 verboseforeman (interactive installation).log (2.3 MB) foreman (verbose installation).log (1.6 MB)

Looks like you have some packages installed that are not needed and cause dependency conflicts:

[ERROR 2020-08-02T15:15:50 main]  Problem: problem with installed package rubygem-irb-1.0.0-106.module_el8.1.0+249+93480f15.noarch
[ERROR 2020-08-02T15:15:50 main]   - package rubygem-irb-1.0.0-106.module_el8.1.0+249+93480f15.noarch requires ruby(rubygems) >= 3.0.3, but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - package rubygems-3.0.3-106.module_el8.1.0+249+93480f15.noarch requires rubygem(psych) >= 3.1.0, but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - rubygem-psych-3.1.0-106.module_el8.1.0+249+93480f15.i686 has inferior architecture
[ERROR 2020-08-02T15:15:50 main]   - package rubygem-psych-3.1.0-106.module_el8.1.0+249+93480f15.x86_64 requires libruby.so.2.6()(64bit), but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - cannot install both ruby-libs-2.5.5-105.module_el8.1.0+214+9be47fd7.x86_64 and ruby-libs-2.6.3-106.module_el8.1.0+249+93480f15.x86_64
[ERROR 2020-08-02T15:15:50 main]   - cannot install both ruby-libs-2.6.3-106.module_el8.1.0+249+93480f15.x86_64 and ruby-libs-2.5.5-105.module_el8.1.0+214+9be47fd7.x86_64
[ERROR 2020-08-02T15:15:50 main]   - package rubygem-bcrypt-3.1.12-3.el8.x86_64 requires libruby.so.2.5()(64bit), but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - package foreman-2.1.0-1.el8.noarch requires rubygem(bcrypt) >= 3.1, but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - package foreman-2.1.0-1.el8.noarch requires rubygem(bcrypt) < 4.0, but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - package foreman-postgresql-2.1.0-1.el8.noarch requires foreman = 2.1.0-1.el8, but none of the providers can be installed
[ERROR 2020-08-02T15:15:50 main]   - conflicting requests

I would suggest unistalling rubygem-irb and trying again. Additionally, EPEL is not required for Foreman on CentOS 8, there might be some more conflict caused by it (we know of one conflict with rubygem-net-ssh that is in the release notes, but there may be others that only show up with certain setups)

Also, looks like you may have ruby 2.5 libraries installed while the Foreman requires 2.6

I’ll let @packaging reply here, but IIRC Foreman was built against Ruby 2.5 while the default Ruby on EL8 is Ruby 2.6.

default ruby on EL8 is sill 2.5

[root@3a52b9319aed /]# cat /etc/centos-release
CentOS Linux release 8.2.2004 (Core) 
[root@3a52b9319aed /]# ruby --version
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

So I’ve found 1 problem so far:

  • when you run “yum list installed” it should be noted that the output is formatted by default. For RPMs with very long names, the version and repository name (e.g @AppStream) will appear on the line following the RPMs name. Therefore using “yum list installed | grep @AppStream” might miss RPM file names and therefore not download the whole repository.
    This is the same on CentOS 7 as well.
    Is there a way to get “yum list installed” not to format the output so that all the details for a repository are on a single line? This formatting breaks basic Linux/Unix principles.

I opened a query in the Red Hat Community if anyone has duplicated an installed Linux’s repository as was done on CentOS / Red Hat 7. See https://learn.redhat.com/t5/Platform-Linux/Download-RHEL-8-repositories-for-air-gap-installation/m-p/13159#M975

Looks like i was wrong here- Foreman on EL8 builds against ruby 2.5, which is the default still in EL8.
It would appear for some reason there are ruby 2.6 libraries available on the system, which conflict with the libraries required by foreman.
Is this a fresh EL8 machine?
Is it possible the ruby 2.6 module has been enabled? Can you share the output of dnf module list --enabled? and rpm -qa |grep ruby-?

Attached.
But I think that there is some other inherent issue with the process of creating an offline repository for CentOS 8. It seems that copying the installed RPMs seems to be an issue to begin with.rpm-qa_grep_ruby-.output.gz (184 Bytes) dnf_module_list–enabled.output.gz (700 Bytes)

The output of the rpm -qa seems to be an empty archive?
In any case, the conflict indicates some mismatch between different ruby versions being installed on the machine. I’m not sure where it came from, but the rubygem-irb you have installed is conflicting with Foreman as it requires (through a dependency chain) ruby-libs-2.6.3.
I would suggest to try uninstalling ruby-libs-2.6.3 and all the packages that depend on it, followed by rerunning the installer. As previously mentioned, you may also want to disable the EPEL repo as it is not required for Foreman and includes at least one conflicting package, possibly more.

With regards to the repo sync itself, considering that disconnected installs are not a supported and tested setup, I’m afraid that ensuring properly synced repos are available is left as an exercise to the user.

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