the dependency packages cannot be uninstalled correctly when yum 3.x is upgraded to dnf 4.x
weli-l opened this issue · comments
When upgrading the package, I encountered the following issues:
In my environment, the previous package was installed using yum 3.xx. However, with the system upgrade, we are now using a newer version of dnf 4.xxx. This has led to the replacement of dependency parsing tools.
During the system upgrade, the rpm -Uvh *.rpm command is used. This will upgrade yum 3.x to dnf 4.x. Before the upgrade, the /var/lib/dnf directory does not exist. After the upgrade, the /var/lib/dnf directory exists but is empty. As a result, when I attempt to uninstall the software package before the upgrade, the dependency packages cannot be uninstalled correctly.
That's expected. Without the history database (located in /var/lib/dnf), DNF can't figure out if the "myapp_deps" package is a leftover dependency or if the user installed it explicitly. So, to be safe, it keeps packages with an unknown reason installed.
In the history database, DNF keeps track of the "reason" for each installed package. This reason can be either "user" (meaning the user explicitly installed the package, like running dnf install myapp_deps
) or "dependency" (like "myapp_deps" in dnf install myapp
). DNF only automatically removes packages with a "dependency" reason that are no longer needed by any installed packages.
That's expected. Without the history database (located in /var/lib/dnf), DNF can't figure out if the "myapp_deps" package is a leftover dependency or if the user installed it explicitly. So, to be safe, it keeps packages with an unknown reason installed.
In the history database, DNF keeps track of the "reason" for each installed package. This reason can be either "user" (meaning the user explicitly installed the package, like running
dnf install myapp_deps
) or "dependency" (like "myapp_deps" indnf install myapp
). DNF only automatically removes packages with a "dependency" reason that are no longer needed by any installed packages.
thanks for your reply
One more thing - you can change the stored reason for a specific package using dnf mark install <package-spec>
to set the reason to "user", or dnf mark remove <package-spec>
to set it to "dependency". See man dnf
and search for "Mark Command".
One more thing - you can change the stored reason for a specific package using
dnf mark install <package-spec>
to set the reason to "user", ordnf mark remove <package-spec>
to set it to "dependency". Seeman dnf
and search for "Mark Command".
yes, actually that's what i did, thanks