Bug 1755005

Summary: dnf module: A switched stream does not have "[i]" even when the RPMs are installed.
Product: [Fedora] Fedora Reporter: Jun Aruga <jaruga>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-27 09:12:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jun Aruga 2019-09-24 14:13:36 UTC
Description of problem:

On Fedora 31 container, seeing "dnf module list ruby",

1. After "dnf module install ruby:2.5", the 2.5 stream has "[e]" and "[i]".
2. Then after "dnf module enable ruby:2.6" the "2.6" stream has "[e]".
3. But after running "dnf distro-sync" to install RPMs in ruby:2.6 module, the ruby "2.6" stream does not have "[i]" even when "ruby:2.6" is actually installed. This is not intuitive. Is it intentional? Is there a way to see "[i]" for ruby:2.6 stream?

This report is originally from https://pagure.io/modularity/issue/155 .


Version-Release number of selected component (if applicable):
# rpm -q dnf
dnf-4.2.9-1.fc31.noarch
(Maybe, I did not record it when I faced the issue).

How reproducible:


Steps to Reproduce:
1. $ podman run --rm -it fedora:31 bash
2. # dnf module install ruby:2.5
3. # dnf module reset ruby
4. # dnf module enable ruby:2.6
5. # dnf distro-sync
6. Run following command to check ruby:2.6's ruby RPM is installed.

# rpm -q ruby
ruby-2.6.3-120.module_f31+4421+40d78b82.x86_64

7. dnf module list ruby


Actual results:

```
Last metadata expiration check: 0:00:15 ago on Fri Sep 20 13:47:02 2019.
Fedora Modular 31 - x86_64
Name      Stream      Profiles        Summary                                                 
ruby      master      default         An interpreter of object-oriented scripting language    
ruby      2.5         default [d]     An interpreter of object-oriented scripting language    
ruby      2.6 [e]     default [d]     An interpreter of object-oriented scripting language    

Fedora Modular 31 - x86_64 - Test Updates
Name      Stream      Profiles        Summary                                                 
ruby      master      default         An interpreter of object-oriented scripting language    
ruby      2.5         default [d]     An interpreter of object-oriented scripting language    
ruby      2.6 [e]     default [d]     An interpreter of object-oriented scripting language    

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
```

Expected results:


The 2.6 module stream should be outputted like this with "[i]".

```
ruby     2.6 [e]    default [d] [i]    An interpreter of object-oriented scripting language 
```

Additional info:

Comment 1 Jaroslav Mracek 2019-09-27 09:12:19 UTC
The key information is that "dnf module reset ruby" was used. In this step dnf remove all information about installed content of ruby module.

In past when module switch operation was allowed and dnf remember installed profiler other people complain that this behavior is incorrect, because same profile in different stream could have different package content.

Here is the list of commands that will result in state that you expect:

1. # dnf module install ruby:2.5
2. # dnf module reset ruby
3. # dnf module install ruby:2.6
4. # dnf distro-sync

Comment 2 Jun Aruga 2019-09-27 11:40:00 UTC
Jaroslav, thanks for the answer.

> In past when module switch operation was allowed and dnf remember installed profiler other people complain that this behavior is incorrect, because same profile in different stream could have different package content.

I see. But I see that there is a proposal for module switch operation here.
https://pagure.io/modularity/issue/143

My commands to switch a stream are from below modularity document.

> https://docs.fedoraproject.org/en-US/modularity/using-modules-switching-streams/

```
$ sudo dnf module reset NAME
$ sudo dnf module enable NAME:STREAM
$ sudo dnf --allowerasing distro-sync [RPM]...
```

Do you think it is better to change it to your suggested steps like this?


```
$ sudo dnf module reset NAME
$ sudo dnf module install NAME:STREAM
$ sudo dnf --allowerasing distro-sync [RPM]...
```