Bug 1357083
Summary: | yum clean all does clean up cache from earlier configured and not enabled now repositories | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Steffen Froemer <sfroemer> |
Component: | yum | Assignee: | Michal Domonkos <mdomonko> |
Status: | CLOSED ERRATA | QA Contact: | Eva Mrakova <emrakova> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.2 | CC: | emrakova, james.antill, mdomonko, vmukhame |
Target Milestone: | rc | Keywords: | Patch |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | yum-3.4.3-154.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 09:07:52 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1380360, 1393866 |
Description
Steffen Froemer
2016-07-15 16:24:14 UTC
The reported behaviour is not a bug and is documented in the man page: The following are the ways which you can invoke yum in clean mode. Note that "all files" in the commands below means "all files in currently enabled repositories". If you want to also clean any (temporarily) disabled repositories you need to use --enablerepo='*' option. As this request comes up quite often demonstrating that this behaviour is widely misunderstood, I think it's a good idea to show a hint to use '--enablerepo=\*' whenever a user runs 'yum clean all'. > Expected results:
> The directory of the not configured repository should be removed. It should
> be removed on
> - yum clean all -> all repo cache, for whom no configured repository exist,
> will be deleted
> - subscription-manager repos --disable -> should remove the cache for this
> repo
> - yum-config-manager --disable -> should remove the cache for this repo
Users may temporarily disable and enable repos for various reasons, and many of them rely on the fact that the cache stays intact. Cleaning cache when disabling a repo would definitely be a regression for many users.
(In reply to Valentina Mukhamedzhanova from comment #2) > > As this request comes up quite often demonstrating that this behaviour is > widely misunderstood, I think it's a good idea to show a hint to use > '--enablerepo=\*' whenever a user runs 'yum clean all'. Do you have a proposal, who does this look like? How do we handle this bug (more RFE now)? But what is with data in /var/cache/yum, which are from a repository, of whom no configuration file exist nevermore. Example. Customer create /etc/yum.repo.d/my.repo and synced metadata. After a while, the file will be removed. All data will stay on /var/cache/yum. Should we recognize such behaviour or just ignore it, since it's not the default manner on dealing with repos in yum. > Do you have a proposal, who does this look like? How do we handle this bug > (more RFE now)? We will add a helpful message which users will see whenever they run 'yum clean all'. > But what is with data in /var/cache/yum, which are from a repository, of > whom no configuration file exist nevermore. > > Example. > Customer create /etc/yum.repo.d/my.repo and synced metadata. After a while, > the file will be removed. All data will stay on /var/cache/yum. Should we > recognize such behaviour or just ignore it, since it's not the default > manner on dealing with repos in yum. This use case is fairly rare, and it doesn't make much sense to me to implement a command which would exactly duplicate the functionality of 'rm -rf /var/cache/yum'. But we can show a message hint for that too. Okay, for summary. - A note will be displayed, if using 'yum clean all' that only enabled repos cleaned up and if I want to clean up cache from disabled repos, I have to use command line option '--enablerepo=*' - if there are folders from repositories, they don't exist in any of the configurations in /etc/yum.repos.d/*.repo a hint will be displayed, that there are files left in /var/cache/yum, which are not automatically cleaned up. Are you agree? I must revert my last comment. I not agree with the statement, that remaining cache from not configured repos is fairly rare. What arguments are against that 'yum clean all' also removes data in cache-directory, which are not needed? Yes, it will duplicate functionality of rm -rf /var/cache/yum, but on the other hand, if I use this command, I also remove cache from disabled repos. That's not want I want. 'yum clean all' should do following three steps by default: - clean all cache from enabled repos - preserve cache of disabled repos - remove all data from unknown repos -> additional give a hint, that disabled repos will not be cleaned up. Can I get some information on this topic? > What arguments are against that 'yum clean all' also removes data in > cache-directory, which are not needed? For example, when rhn-channel disables its repository - yum has no knowledge of it, which makes it look for yum as if the repository is not simply disabled, but nonexistent. But as described in comment 4, we don't want to clean the cache in this case. (In reply to Valentina Mukhamedzhanova from comment #10) > For example, when rhn-channel disables its repository - yum has no knowledge > of it, which makes it look for yum as if the repository is not simply > disabled, but nonexistent. But as described in comment 4, we don't want to > clean the cache in this case. In my eyes, unsubscribing and disabling are real different things. If I temporarily don't want to have access on a channel/repo, I should disable this. But if we don't can change this behavior, do you see a possibility to add a new cleanup-command like 'yum clean all-unknown-data' or something similar, which will do a 'yum clean all' additionally remove the unknown repo-data? In the end, my Customer would like to have a command available, which will also cleanup cache-data from not existing repos. Any recommondation on this? Let's make it simple for now by just printing this hint when you run "yum clean": Only enabled repos are being cleaned. Use together with --enablerepo/--disablerepo for more control. Adding a hint about running "rm -rf /var/cache/yum" would probably make it too verbose. While we could only print it in case there's some leftover data from non-existent repos, that would require us to walk the whole directory tree and potentially slow down the whole operation. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2295 |