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

'dnf install' in rpm-ostree image reports a transaction lock error

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • rhel-9.6
    • rhel-9.5
    • dnf
    • dnf-4.14.0-18.el9
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 4
    • 10
    • 5
    • Hide

      Stuck on upstream review.

      Show
      Stuck on upstream review.
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • Yes
    • None
    • Hide

      From within a running RHEL 9 ostree or bootc image, running "dnf" should result in an error indicating the host is an image-based system and changes cannot be made to the system.

      Second, running "dnf --installroot=/writable/mountpoint" on an OSTree system without bootc overlay enabled should work and not raise an error.

      Third, from within a running RHEL 9 ostree or bootc image, use "bootc usroverlay" to enable changes to the filesystem and then see that running dnf works as-expected.

      Show
      From within a running RHEL 9 ostree or bootc image, running "dnf" should result in an error indicating the host is an image-based system and changes cannot be made to the system. Second, running "dnf --installroot=/writable/mountpoint" on an OSTree system without bootc overlay enabled should work and not raise an error. Third, from within a running RHEL 9 ostree or bootc image, use "bootc usroverlay" to enable changes to the filesystem and then see that running dnf works as-expected.
    • Pass
    • Automated
    • Enhancement
    • Hide
      Feature, enhancement: Better error message when using DNF on a locked OSTree system or a bootc system without usr-overlay.
      Reason: OSTree and bootc systems cannot be managed by DNF by default. The current error message about a read-only file system was not explaining that it's normal and how to change it.
      Result: DNF now detects whether it runs on a read-only OSTree or bootc system and advises the user where to find more details about making the system manageable with DNF.
      Show
      Feature, enhancement: Better error message when using DNF on a locked OSTree system or a bootc system without usr-overlay. Reason: OSTree and bootc systems cannot be managed by DNF by default. The current error message about a read-only file system was not explaining that it's normal and how to change it. Result: DNF now detects whether it runs on a read-only OSTree or bootc system and advises the user where to find more details about making the system manageable with DNF.
    • Proposed
    • None

      'dnf install' and rpm does this on ostree/bootc (and in general, image based systems):

      error: can't create transaction lock on /usr/share/rpm/.rpm.lock (Read-only file system)
      

      This happens to only be the first error; beyond that on an image-based system the `/usr` filesystem is read-only by default.

      Instead, we should land code in dnf (and ideally, rpm) that: gives an improved error message that redirects users to a canonical documentation page that we will keep up to date.

      For example, on RHEL:

      ```
      $ dnf -y install strace
      error: system is configured to be read-only; for more information see https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_software_with_the_dnf_tool/assembly_image_mode
      ```

      Yes I'm proposing this links directly to the "managing software with dnf" section of the RHEL docs; and part of the deliverable here is we provide useful information there, with best practices and recommendations.

      (The documentation of course gets into a larger problem that docs aren't generally shared between fedora and RHEL, and we should do something useful on Fedora too, that could link to something underneath https://docs.fedoraproject.org/en-US/bootc/ perhaps there, as a build-time config)

              rhn-support-ppisar Petr Pisar
              mcurlej Martin Curlej
              packaging-team-maint packaging-team-maint
              Martin Banas Martin Banas
              Mariya Pershina Mariya Pershina
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: