Bug 1201445
Summary: | "dnf autoremove" removes "user-installed" installonly packages installed using "dnf upgrade" | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Conley Moorhous <csmoorhous> | ||||||||||
Component: | dnf | Assignee: | Michael Mráka <mmraka> | ||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||
Severity: | unspecified | Docs Contact: | |||||||||||
Priority: | unspecified | ||||||||||||
Version: | 22 | CC: | ben.r.xiao, csmoorhous, jsilhan, mluscon, mmraka, packaging-team-maint, pnemade, quarry386, rholy, tim.lauridsen | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | dnf-plugins-core-0.1.7-1.fc22 | Doc Type: | Bug Fix | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2015-05-08 07:27: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: | |||||||||||||
Attachments: |
|
Created attachment 1001154 [details]
dnf history list
Created attachment 1001155 [details]
dnf history userinstalled
Also, the kernel in use is 4.0.0-0.rc1.git0.1.fc22. See also "dnf info kernel" Created attachment 1001159 [details]
dnf info kernel
Hello, thank you for the report. It's interesting for me that nobody hit this bug before. It seems that if a user installs a kernel using "dnf upgrade", the kernel is marked as a dependency and thus it can be removed using "dnf autoremove". By default, DNF inherits the "installation reason" from the upgraded package during the upgrade process but "installonly" packages are exceptions because in fact, they do not *replace* another packages. The question is what is the correct solution. Should we always mark all installonly packages as "user-installed"? Should we ignore "reasons" when considering installonlies for autoremoval? Should we inherit the reason from another installed versions? I suggest you to install the kernel using "dnf install" as a workaround. Here's what I get: conley@conley:~$ sudo dnf install kernel Using metadata from Fri Mar 13 18:30:21 2015 Package kernel-4.0.0-0.rc1.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc1.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc1.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc1.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. Dependencies resolved. Nothing to do. Not sure if this is related or should be a different bug, but "yum upgrade" gave me a bunch of potential updates but then had a failed dependency resolution. "dnf upgrade" reported "nothing to do." After asking on IRC, I was told to try "dnf clean all" After this, dnf found all the upgrades and was able to install them. (In reply to Radek Holy from comment #5) > The question is what is the correct solution. Should we always mark all > installonly packages as "user-installed"? Should we ignore "reasons" when > considering installonlies for autoremoval? Should we inherit the reason from > another installed versions? It seem to me the correct solution is to inherit the reason from previously installed version. (In reply to Conley Moorhous from comment #7) > Here's what I get: > > conley@conley:~$ sudo dnf install kernel > Using metadata from Fri Mar 13 18:30:21 2015 [...] > Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. > Dependencies resolved. > Nothing to do. So far, "dnf install kernel" checks if there is any version of "kernel" and if there is, it considers the request as satisfied, otherwise it installs the latest version. We are working on changing the behavior so that "dnf install kernel" should check if there is *the latest* version of "kernel" installed... My suggestion was to use "dnf install kernel-4.0.0-0.rc2.git0.1.fc22" as the workaround. (In reply to Conley Moorhous from comment #8) > Not sure if this is related or should be a different bug, but "yum upgrade" > gave me a bunch of potential updates but then had a failed dependency > resolution. "dnf upgrade" reported "nothing to do." After asking on IRC, I > was told to try "dnf clean all" After this, dnf found all the upgrades and > was able to install them. See http://dnf.readthedocs.org/en/latest/user_faq.html#why-do-i-get-different-results-with-dnf-upgrade-vs-yum-update . You can also use "dnf --refresh upgrade" as a shortcut. If there is an issue, let's discuss it somewhere else. (In reply to Radek Holy from comment #10) > (In reply to Conley Moorhous from comment #7) > > Here's what I get: > > > > conley@conley:~$ sudo dnf install kernel > > Using metadata from Fri Mar 13 18:30:21 2015 > [...] > > Package kernel-4.0.0-0.rc2.git0.1.fc22.x86_64 is already installed, skipping. > > Dependencies resolved. > > Nothing to do. > > So far, "dnf install kernel" checks if there is any version of "kernel" and > if there is, it considers the request as satisfied, otherwise it installs > the latest version. We are working on changing the behavior so that "dnf > install kernel" should check if there is *the latest* version of "kernel" > installed... > > My suggestion was to use "dnf install kernel-4.0.0-0.rc2.git0.1.fc22" as the > workaround. I can't seem to get it to work: conley@conley:~$ sudo dnf install kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 Using metadata from Sun Mar 15 19:06:08 2015 Package kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 is already installed, skipping. Package kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 is already installed, skipping. Dependencies resolved. Nothing to do. conley@conley:~$ sudo dnf upgrade-to kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 Using metadata from Sun Mar 15 19:06:08 2015 Dependencies resolved. Nothing to do. conley@conley:~$ sudo dnf reinstall kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 Using metadata from Sun Mar 15 19:06:08 2015 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Reinstalling: kernel x86_64 4.0.0-0.rc3.git0.1.fc22 updates-testing 59 k Transaction Summary ================================================================================ Total download size: 59 k Is this ok [y/N]: y Downloading Packages: kernel-4.0.0-0.rc3.git0.1.fc22.x86_64.rpm 46 kB/s | 59 kB 00:01 -------------------------------------------------------------------------------- Total 27 kB/s | 59 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Reinstalling: kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 1/2 Erasing : kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 2/2 Verifying : kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 1/2 Verifying : kernel-4.0.0-0.rc3.git0.1.fc22.x86_64 2/2 Reinstalled: kernel.x86_64 4.0.0-0.rc3.git0.1.fc22 Complete! conley@conley:~$ sudo dnf remove kernel Using metadata from Sun Mar 15 19:06:08 2015 Dependencies resolved. Error: The operation would result in removing the booted kernel: kernel-core-4.0.0-0.rc1.git0.1.fc22.x86_64. conley@conley:~$ sudo dnf remove kernel-core-4.0.0-0.rc1.git0.1.fc22.x86_64 Using metadata from Sun Mar 15 19:06:08 2015 Dependencies resolved. Error: The operation would result in removing the booted kernel: kernel-core-4.0.0-0.rc1.git0.1.fc22.x86_64. conley@conley:~$ OK, let me describe the suggestion... I assumed that you are in a state where kernel-4.0.0-0.rc1.git0.1.fc22 is running and no other kernel is installed. I assumed that your goal is to install kernel-4.0.0-0.rc2.git0.1.fc22 in such a way that it won't be removed by "dnf autoremove". As the workaround in the meantime, this can be achieved by "dnf install kernel-4.0.0-0.rc2.git0.1.fc22" instead of "dnf upgrade". Oh, I get it. Yes, that resolves this issue. Apparently there is another bug with dnf or something because I cannot make F22 run the latest version of the kernel, even after dnf installs it; uname -a still reports that I'm running rc1 My dumb mistake, I hadn't installed GRUB so naturally the new kernels were not being booted. Sorry for clogging up this bug report *** Bug 1213043 has been marked as a duplicate of this bug. *** Fixed in upstream by https://github.com/rpm-software-management/dnf/pull/257 dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 Package dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.1.7-1.fc22 hawkey-0.5.5-1.fc22 dnf-1.0.0-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-7483/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 then log in and leave karma (feedback). dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. (In reply to Michael Mráka from comment #16) > Fixed in upstream by > https://github.com/rpm-software-management/dnf/pull/257 I still have a problem with dnf. When performing # dnf autoremove I get an error "Error: The operation would result in removing the booted kernel: kernel-core-4.0.7-300.fc22.x86_64." dnf and plugins-core versions: dnf-1.0.1-2.fc22.noarch dnf-plugins-core-0.1.9-1.fc22.noarch Still seeing this issue on Fedora 24 with kernel-modules-extra. This is not related to the autoremove bug from Fedora 23. |
Created attachment 1001153 [details] The output of a bash script iterating over and listing the info of each dnf transaction Description of problem: Autoremove removes kernel, kernel-core, and kernel-modules, while upgrade installs them (all version 4.0.0-0.rc2.git0.1.fc22). This can be done as many times as you like. Version-Release number of selected component (if applicable): 0.6.4 2.fc22 How reproducible: Always Steps to Reproduce: 1. 'dnf autoremove' 2. 'dnf upgrade' 3. 'dnf autoremove' 4. 'dnf upgrade' 5. ... Actual results: The latest version of kernel, kernel-core, and kernel-modules is autoremoved and installed by "dnf autoremove" and "dnf upgrade" respectively Expected results: "dnf autoremove" does not autoremove the kernel packages Additional info: I don't know how to list the info of each historical transaction with dnf, so I ran for i in {1..40}; do echo -e `sudo dnf history info $i` "\n\n"; done It is attached as dnf-history-info. Likewise, "dnf history list" is attached as dnf-history-list and "dnf history userinstalled" is attached as dnf-history-userinstalled. Notably, "kernel" is listed as user installed. I think it may have been listed as a dependency of some program.