Description of problem: When uninstalling a package previously installed with PackageKit (GNOME Software or pkcon) on latest Fedora Rawhide using dnf remove, dnf does not find any unused dependencies and uninstalls only the base package. No dependencies are also found when running dnf autoremove afterwards. This seems to be a dnf regression, see the link from Additional info. Version-Release number of selected component (if applicable): dnf-4.2.7-2.fc31.noarch PackageKit-1.1.12-10.fc31.x86_64 How reproducible: Every time. Steps to Reproduce: 1. Install some package that has additional dependencies with pkcon. 2. After the installation, try uninstalling the package using "dnf remove". Actual results: Only the base package is uninstalled. Expected results: Both the base package and the previously installed dependencies are uninstalled. Additional info: https://github.com/hughsie/PackageKit/issues/201#issuecomment-515067267
I beliew that the problem is what is stored in transaction database (swdb) after PackageKit transaction. I would like to ask PackageKit maintainers to take a look (I know that the code is probably in libdnf, but originate a lot from libhif). If you don't want to fix it please close it as a won't fix as a sign that PackageKit is unmaintained.
Let's hope that GNOME Software will soon switch to libdnf instead of using PackageKit. :-)
I have tested this with various Fedora versions and it seems that the issue happens since Fedora 29. It worked fine in Fedora 28.
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle. Changing version to '31'.
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle. Changing version to 31.
So what is the status here? Any chance this will be fixed (in dnf or PackageKit)?
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle. Changing version to 32.
Still the same issue on Fedora 33.
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34.
Still a problem.
> Let's hope that GNOME Software will soon switch to libdnf instead of using PackageKit We can do that when dnfdaemon exists. Until then we need PK to act as the privileged helper.
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle. Changing version to 35.
https://github.com/PackageKit/PackageKit/pull/526 This should be fixed in PackageKit upstream as of three days ago, when Neal Gompa merged the above PR (closing a 3.5-year-old Issue in the process). The PR added support for properly setting (or NOT setting) 'userinstalled' flags on dependencies installed by PackageKit. (Which means packages it installs only as *dependencies* of packages requested by the user will properly show up as `dnf autoremove` candidates, and will be included in uninstall transactions if the packages that pulled them in are being removed.)
Nice, great work! It will also be needed to enabled the "packagekit_autoremove" build option in GNOME Software Fedora spec file to have this also working in GUI on Fedora Workstation. Adding Milan Crha to CC.
> It will also be needed to enabled the "packagekit_autoremove" build option in GNOME Software Fedora spec file to have this also working in GUI on Fedora Workstation. It requires a PackageKit build with the change added, to add a dependency on it, otherwise the package removal can fail as "not supported" with older PackageKit version. I suggest to close this bug and open a new gnome-software bug once the PackageKit with that fix reaches rawhide.
Still the same issue on latest Rawhide, however since PackageKit 1.2.5, a "pkcon remove <package> --autoremove" command can be used instead.
This message is a reminder that Fedora Linux 35 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '35'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 35 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Could this be fixed by https://src.fedoraproject.org/rpms/gnome-software/c/913366d7d63e62d9fbd302a9c820237b69ad3df2?branch=rawhide , aka bug #2056082 ?
No, because the flag of whether a dependency can be autoremoved is still not set when installing via pkcon. [root@carbon ~]# pkcon install tesseract Resolving [=========================] Loading cache [=========================] Testing changes [=========================] Finished [ ] (0%) The following packages have to be installed: leptonica-1.82.0-6.fc36.x86_64 C library for efficient image processing and image analysis operations tesseract-5.0.1-5.fc36.x86_64 Raw OCR Engine tesseract-langpack-eng-4.1.0-3.fc36.noarch English language data for tesseract-tessdata Proceed with changes? [N/y] y [=========================] Installing [=========================] Querying [=========================] Downloading packages [=========================] Testing changes [=========================] Installing packages [=========================] Finished [=========================] [root@carbon ~]# dnf erase tesseract Dependencies resolved. ============================================================================================================================================================ Package Architecture Version Repository Size ============================================================================================================================================================ Removing: tesseract x86_64 5.0.1-5.fc36 @fedora 3.5 M Removing dependent packages: tesseract-langpack-eng noarch 4.1.0-3.fc36 @fedora 3.9 M Transaction Summary ============================================================================================================================================================ Remove 2 Packages Freed space: 7.4 M Is this ok [y/N]: y Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Erasing : tesseract-5.0.1-5.fc36.x86_64 1/2 Erasing : tesseract-langpack-eng-4.1.0-3.fc36.noarch 2/2 Running scriptlet: tesseract-langpack-eng-4.1.0-3.fc36.noarch 2/2 Verifying : tesseract-5.0.1-5.fc36.x86_64 1/2 Verifying : tesseract-langpack-eng-4.1.0-3.fc36.noarch 2/2 Removed: tesseract-5.0.1-5.fc36.x86_64 tesseract-langpack-eng-4.1.0-3.fc36.noarch Complete! [root@carbon ~]# rpm -q leptonica leptonica-1.82.0-6.fc36.x86_64 Why is leptonica not autoremoved when removing tesseract? If I install tesseract using dnf and then remove it, leptonica gets removed. [root@carbon ~]# dnf install tesseract Last metadata expiration check: 2:17:06 ago on Wed 30 Nov 2022 08:48:50 GMT. Dependencies resolved. ============================================================================================================================================================ Package Architecture Version Repository Size ============================================================================================================================================================ Installing: tesseract x86_64 5.0.1-5.fc36 fedora 1.3 M Installing dependencies: leptonica x86_64 1.82.0-6.fc36 fedora 1.1 M tesseract-langpack-eng noarch 4.1.0-3.fc36 fedora 1.7 M Transaction Summary ============================================================================================================================================================ Install 3 Packages Total download size: 4.2 M Installed size: 10 M Is this ok [y/N]: y Downloading Packages: (1/3): leptonica-1.82.0-6.fc36.x86_64.rpm 1.6 MB/s | 1.1 MB 00:00 (2/3): tesseract-5.0.1-5.fc36.x86_64.rpm 1.7 MB/s | 1.3 MB 00:00 (3/3): tesseract-langpack-eng-4.1.0-3.fc36.noarch.rpm 1.9 MB/s | 1.7 MB 00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 3.1 MB/s | 4.2 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : leptonica-1.82.0-6.fc36.x86_64 1/3 Installing : tesseract-langpack-eng-4.1.0-3.fc36.noarch 2/3 Installing : tesseract-5.0.1-5.fc36.x86_64 3/3 Running scriptlet: tesseract-5.0.1-5.fc36.x86_64 3/3 Verifying : leptonica-1.82.0-6.fc36.x86_64 1/3 Verifying : tesseract-5.0.1-5.fc36.x86_64 2/3 Verifying : tesseract-langpack-eng-4.1.0-3.fc36.noarch 3/3 Installed: leptonica-1.82.0-6.fc36.x86_64 tesseract-5.0.1-5.fc36.x86_64 tesseract-langpack-eng-4.1.0-3.fc36.noarch Complete! [root@carbon ~]# dnf erase tesseract Dependencies resolved. ============================================================================================================================================================ Package Architecture Version Repository Size ============================================================================================================================================================ Removing: tesseract x86_64 5.0.1-5.fc36 @fedora 3.5 M Removing unused dependencies: leptonica x86_64 1.82.0-6.fc36 @fedora 2.9 M tesseract-langpack-eng noarch 4.1.0-3.fc36 @fedora 3.9 M Transaction Summary ============================================================================================================================================================ Remove 3 Packages Freed space: 10 M Is this ok [y/N]: y Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Erasing : tesseract-5.0.1-5.fc36.x86_64 1/3 Erasing : tesseract-langpack-eng-4.1.0-3.fc36.noarch 2/3 Erasing : leptonica-1.82.0-6.fc36.x86_64 3/3 Running scriptlet: leptonica-1.82.0-6.fc36.x86_64 3/3 Verifying : leptonica-1.82.0-6.fc36.x86_64 1/3 Verifying : tesseract-5.0.1-5.fc36.x86_64 2/3 Verifying : tesseract-langpack-eng-4.1.0-3.fc36.noarch 3/3 Removed: leptonica-1.82.0-6.fc36.x86_64 tesseract-5.0.1-5.fc36.x86_64 tesseract-langpack-eng-4.1.0-3.fc36.noarch Complete! The problem is that pkcon install marks everything as user-installed, including the dependencies. In this case, I asked to install tesseract, and tesseract-langpack-eng and leptonica were installed as dependencies. They should not be marked as user-installed, but pkcon does mark them as user-installed. That means leptonica won't be autoremoved.
This is not about gnome-software, it's about using dnf. The UX with dnf is degraded if you ever allow PackageKit (or any frontend like pkcon or Discover or gnome-software) to update and install packages, because PK does not correctly record the "user installed" flag for dependencies that were not explicitly user-installed.
I see, thanks for the detailed explanation. Would it make sense to fill this upstream? The last time I asked there something, the DNF backend maintainer was quite responsive.
Yes, I can do that. You mean PK upstream, not DNF upstream, right?
Correct, the PackageKit upstream: https://github.com/PackageKit/PackageKit/ For what it's worth, I tried this in Fedora 37 with PackageKit-1.2.5-2.fc37.x86_64 libdnf-0.68.0-1.fc37.x86_64 and it behaves the same as you said at comment #19.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle. Changing version to 39.
This is now fixed in libdnf upstream: https://github.com/rpm-software-management/libdnf/pull/1628 Unfortunately it is not retroactive as the dependencies previously installed by packagekit are already committed as userinstalled to the database.
Still, it's something! I wonder if the next system upgrade will correct that, for affected users? Or will the upgraded packages all inherit the userinstalled status?
They will keep their userinstalled status
FEDORA-2023-a066057708 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a066057708
FEDORA-2023-a066057708 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a066057708` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a066057708 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
Proposed as a Freeze Exception for 39-final by Fedora user asciiwolf using the blocker tracking app because: When uninstalling a package previously installed with PackageKit using dnf, no unused dependencies are found and removed. This was fixed in the latest dnf/libdnf update, however the fix is not retroactive as the dependencies previously installed by PackageKit are already committed as userinstalled to the database. Because of this, it would be a good idea to push this fix into F39 before the Final release.
+4 in https://pagure.io/fedora-qa/blocker-review/issue/1416 , marking accepted FE.
FEDORA-2023-a066057708 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.