Bug 1730807
Summary: | Behavior of dnf module remove | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jun Aruga <jaruga> |
Component: | dnf | Assignee: | Jaroslav Mracek <jmracek> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 30 | CC: | asamalik, dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | dnf-4.2.11-2.fc30 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-10-10 16:55:55 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-07-17 17:30:18 UTC
> Remove installed module profiles, including their packages. In case no profile was provided, all installed profiles get removed.
I have one more question.
How to remove a RPM that is not included in any profile of a module?
Every RPM in a module should be included in a profile of the module?
For example, "ruby-doc", "rubygem-pg" and "rubygem-pg-doc" are not included in any profile of modules/ruby:2.6 .
We can see all the RPM in ruby:2.6 like this.
```
$ dnf module info ruby:2.6
...
Artifacts : ruby-0:2.6.3-120.module_f30+4422+f50e013d.i686
...
: ruby-doc-0:2.6.3-120.module_f30+4422+f50e013d.noarch
...
: rubygem-pg-0:1.1.4-3.module_f30+4422+f50e013d.src
: rubygem-pg-0:1.1.4-3.module_f30+4422+f50e013d.x86_64
...
: rubygem-pg-doc-0:1.1.4-3.module_f30+4422+f50e013d.noarch
```
Below is the right way to install and remove the RPMs that are not included in any profile of a module?
```
$ sudo dnf module enable ruby:2.6
$ sudo dnf install ruby-doc rubygem-pg rubygem-pg-doc
$ rpm -q ruby-doc rubygem-pg rubygem-pg-doc
ruby-doc-2.6.3-120.module_f30+4422+f50e013d.noarch
rubygem-pg-1.1.4-3.module_f30+4422+f50e013d.x86_64
rubygem-pg-doc-1.1.4-3.module_f30+4422+f50e013d.noarch
$ sudo dnf remove ruby-doc rubygem-pg rubygem-pg-doc
$ rpm -q ruby-doc rubygem-pg rubygem-pg-doc
package ruby-doc is not installed
package rubygem-pg is not installed
package rubygem-pg-doc is not installed
```
I tried to reproduce your issue but without a success. See: I had no ruby package on my system and a run: "sudo dnf module install ruby:2.6/default". It installed ruby package and 10 others as a dependencies. Then command "dnf module remove ruby" removed 11 packages included ruby package. But what you experienced could be due. 1. ruby package was installed before "sudo dnf module install ruby:2.6/default". Dnf remember the reason why package appears on the system. The reason could be changed by "dnf mark group ruby" command 2. "dnf module remove ruby" cannot remove ruby package because other user installed package depends on it This is a protection to system So far I don't see the behaviour as a bug. To your questions: Yes you can install any package from the module on your system and also remove it. I create a patch that enhance the documentation of dnf module remove command - https://github.com/rpm-software-management/dnf/pull/1436. Jaroslav, many thanks for checking and sending the patch.
> I tried to reproduce your issue but without a success. See:
Let me see. I try to reproduce considering your situation.
I checked my environment. You are right. The issue happens when ruby and ruby-devel RPM packages are installed before running "dnf module install ruby:2.6/default". Initial condition. Ruby module is not enabled. ``` $ dnf module list ruby ... Fedora Modular 30 - x86_64 - Updates Name Stream Profiles Summary ruby master default An interpreter of object-oriented scripting language ruby 2.5 default An interpreter of object-oriented scripting language ruby 2.6 default An interpreter of object-oriented scripting language Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled $ rpm -q ruby package ruby is not installed ``` Install ruby and ruby-devel RPMs without Ruby module. ``` $ sudo dnf install ruby ... Installed: ruby-2.6.3-120.fc30.x86_64 rubygem-bigdecimal-1.4.1-120.fc30.x86_64 rubygem-did_you_mean-1.3.0-120.fc30.noarch rubygem-io-console-0.4.7-120.fc30.x86_64 rubygem-openssl-2.1.2-120.fc30.x86_64 rubygem-rdoc-6.1.0-120.fc30.noarch rubygems-3.0.3-120.fc30.noarch ruby-libs-2.6.3-120.fc30.x86_64 rubygem-irb-1.0.0-120.fc30.noarch rubygem-psych-3.1.0-120.fc30.x86_64 rubygem-json-2.2.0-200.fc30.x86_64 rubypick-1.1.1-10.fc30.noarch Complete! $ sudo dnf install ruby-devel ... Installed: ruby-devel-2.6.3-120.fc30.x86_64 Complete! ``` Then install Ruby 2.6 module. Only ruby, ruby-devel and ruby-libs are updated. This was already unintended situation. ``` $ sudo dnf module install ruby:2.6/default ... Upgrading: ruby x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 42 k ruby-devel x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 199 k ruby-libs x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 2.9 M Installing module profiles: ruby/default Enabling module streams: ruby 2.6 ... Total download size: 3.1 M Is this ok [y/N]: y ... Upgraded: ruby-2.6.3-120.module_f30+4422+f50e013d.x86_64 ruby-devel-2.6.3-120.module_f30+4422+f50e013d.x86_64 ruby-libs-2.6.3-120.module_f30+4422+f50e013d.x86_64 Complete! ``` Here is what I reported. ``` $ sudo dnf module remove ruby:2.6/default Last metadata expiration check: 0:04:44 ago on Tue 23 Jul 2019 11:43:03 AM CEST. Dependencies resolved. ============================================================================================== Package Architecture Version Repository Size ============================================================================================== Disabling module profiles: ruby/default Transaction Summary ============================================================================================== Is this ok [y/N]: y Complete! ``` ``` $ dnf module list ruby ... Name Stream Profiles Summary ruby master default An interpreter of object-oriented scripting language ruby 2.5 default An interpreter of object-oriented scripting language ruby 2.6 [e] default An interpreter of object-oriented scripting language Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled ``` I tried to remove ruby module with "--allowerasing" option. Because I wanted to remove RPMs in Ruby module that other package depends on. I do not understand "Unable to match profile in argument ruby:2.6/default" message. What it means? ``` $ sudo dnf --allowerasing module remove ruby:2.6/default Last metadata expiration check: 0:06:46 ago on Tue 23 Jul 2019 11:43:03 AM CEST. Unable to match profile in argument ruby:2.6/default Dependencies resolved. Nothing to do. Complete! $ sudo dnf module remove ruby:2.6/default Last metadata expiration check: 0:07:40 ago on Tue 23 Jul 2019 11:43:03 AM CEST. Unable to match profile in argument ruby:2.6/default Dependencies resolved. Nothing to do. Complete! ``` https://docs.fedoraproject.org/en-US/modularity/using-modules/#_installing_modules I want "dnf module something" command which do "install ruby package and 10 others as a dependencies" like new installation even some RPMs (ruby, ruby-devel, and etc) in the profile are already install. Current result of "sudo dnf --allowerasing module install ruby:2.6/default" is not like that. ``` $ rpm -q ruby ruby-devel ruby-2.6.3-120.fc30.x86_64 ruby-devel-2.6.3-120.fc30.x86_64 $ sudo dnf module reset ruby $ sudo dnf --allowerasing module install ruby:2.6/default Last metadata expiration check: 0:00:14 ago on Tue 23 Jul 2019 01:41:09 PM CEST. Dependencies resolved. ============================================================================================== Package Arch Version Repository Size ============================================================================================== Upgrading: ruby x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 42 k ruby-devel x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 199 k ruby-libs x86_64 2.6.3-120.module_f30+4422+f50e013d updates-modular 2.9 M Installing module profiles: ruby/default-------------------------------------------------------------------------------- Enabling module streams: ruby 2.6--------------------------------------------------------------- Transaction Summary ============================================================================================== Upgrade 3 Packages Total download size: 3.1 M Is this ok [y/N]:- ``` DNF remembers a reason how package appears on the system in first plase. The strongest is user, then group, then dependency. Ok, Lets go with your example: no ruby on the system. sudo dnf install ruby # installs ruby with reason user, other packages have a reason dependency # user installed packages are not removed by "dnf module remove" command sudo dnf module install ruby:2.6/default # installs module profile called "default" that consist only ruby package # It upgrades ruby package to modular version, but it keeps reason user, because reason is inherited. # Profile 'default' is marked as installed sudo dnf module remove ruby:2.6/default # remove profile named default # it also tries to remove ruby package because it is described in profile, but it cannot because ruby package is user installed. Only group installed packages can be removed. To provide functionality like you expect you can: 1: no ruby package on the system sudo dnf install ruby sudo dnf module install ruby:2.6/default sudo dnf mark group ruby # it will change reason of ruby package to group sudo dnf module remove ruby:2.6/default # ruby package will go away or 2: no ruby package on the system sudo dnf module install ruby:2.6/default # it will installs ruby package with group reason sudo dnf module remove ruby:2.6/default # ruby package will go away Thanks for very detailed explanation. I understand the behavior now. Is it possible to update below Fedora modurarity's document as a NOTE? https://docs.fedoraproject.org/en-US/modularity/using-modules/#_installing_modules It might be after below PR will be merged, as it modifies the page. https://pagure.io/fedora-docs/modularity/pull-request/64 Jun: I'll get it into the docs and post a link back here. Adam, sure. b FEDORA-2019-049b4836a6 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-049b4836a6 dnf-4.2.11-2.fc30, dnf-plugins-core-4.0.10-1.fc30, libdnf-0.35.5-2.fc30, librepo-1.10.6-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-049b4836a6 I've just documented that. It will appear in about an hour after this comment on this URL: https://docs.fedoraproject.org/en-US/modularity/removing-modules/ Commit: https://pagure.io/fedora-docs/modularity/c/30a3aad48f901fa948e0db63b635a3db25e3ca13?branch=master Thanks for improving dnf, and the updated document! The document looks good to me!
> https://bodhi.fedoraproject.org/updates/FEDORA-2019-049b4836a6
What behavior is "dnf" changed about this ticket?
Which item in the bodhi release note is related to this ticket?
dnf-4.2.11-2.fc30, dnf-plugins-core-4.0.10-1.fc30, libdnf-0.35.5-2.fc30, librepo-1.10.6-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report. |