Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yum autoremove tries to remove systemd #80

Closed
jamescassell opened this issue Aug 6, 2018 · 1 comment
Closed

yum autoremove tries to remove systemd #80

jamescassell opened this issue Aug 6, 2018 · 1 comment

Comments

@jamescassell
Copy link

When running yum autoremove, yum tries to remove systemd, even though systemd is marked as 'reason: user' in yumdb.

In my case, I'm trying to remove policycoreutils-python (in a container), which indirectly depends on shadow-utils, which is required by systemd.

I can workaround the issue by yumdb set reason user shadow-utils to make the autoremove successful.

The reason seems to be that required_packages() and requiring_packages() do not run recursively:

yum/yum/rpmsack.py

Lines 115 to 128 in 1222f37

def requiring_packages(self):
"""return list of installed pkgs requiring this package"""
pkgset = set()
for (reqn, reqf, reqevr) in self.provides:
for pkg in self.rpmdb.getRequires(reqn,reqf,reqevr):
if pkg != self:
pkgset.add(pkg)
for fn in self.filelist + self.dirlist:
for pkg in self.rpmdb.getRequires(fn, None, (None, None, None)):
if pkg != self:
pkgset.add(pkg)
return list(pkgset)

yum/yum/rpmsack.py

Lines 131 to 138 in 1222f37

def required_packages(self):
pkgset = set()
for (reqn, reqf, reqevr) in self.strong_requires:
for pkg in self.rpmdb.getProvides(reqn, reqf, reqevr):
if pkg != self:
pkgset.add(pkg)
return list(pkgset)

@dmnks
Copy link
Contributor

dmnks commented Feb 12, 2020

Thank you for the report. However, please note that this project has been deprecated and is no longer maintained upstream. Please consider migrating to DNF which is the successor of YUM. That said, I’ll close this issue now.

@dmnks dmnks closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants