Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-55715

[bootc] "sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory" after installing environment-modules and scl-utils

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • rhel-9.4
    • rhel-bootc-container
    • No
    • Moderate
    • sst_bootc
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      If install environment-modules and scl-utils(these 2 packages are the dependencies of clang) in Containerfile when build image, after boot up the image, we can see the following message on every ssh login.

      sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory

      When building image, the environment-modules post script reports warning:

        Running scriptlet: environment-modules-5.3.0-1.el9.x86_64                 6/7 
      admindir /var/lib/alternatives invalid
      warning: %post(environment-modules-5.3.0-1.el9.x86_64) scriptlet failed, exit status 2
      Error in POSTIN scriptlet in rpm package environment-modules
      

      Not see errors in scl-utils post script.

       

      Please provide the package NVR for which bug is seen:
      environment-modules-5.3.0-1.el9.x86_64
      scl-utils-2.0.3-4.el9.x86_64
       
      How reproducible:
      100%

      Steps to reproduce
      1. Containerfile:
      FROM registry.redhat.io/rhel9/rhel-bootc:latest
      ADD ./rhel.repo /etc/yum.repos.d/rhel.repo 

      RUN dnf install -y environment-modules scl-utils && dnf clean all && rm -f /etc/yum.repos.d/rhel.repo
      RUN systemctl enable NetworkManager.service

       
      2. podman build -t rhel-bootc-test .
      3. podman run -it --rm --name mybootc <image> sudo su -

      • In my testing I use bootc-image-builder to build it as a qcow2 image and start a VM from it, then ssh login. We can see the message after ssh login. But it seems there's a simple way in step3.

      Expected results
      No output after ssh login

      Actual results
      Can see a message after ssh login:
      sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory

            walters@redhat.com Colin Walters
            yuxisun@redhat.com Yuxin Sun
            Colin Walters Colin Walters
            Wei Shi Wei Shi
            Gabriela Necasova Gabriela Necasova
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: