-
Notifications
You must be signed in to change notification settings - Fork 131
Add --oldinstallonly option to remove command #2515
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
base: main
Are you sure you want to change the base?
Conversation
|
Why is the limitation for |
|
Also what's expected behavior regarding to currently installed kernel version? I mean in this situation: What should happen after |
Because this new parameter is intent to remove old packages leaving at least 1 installed. If user want to remove all packages, need to use |
for example, if you have 4 kernels which is installonly package, this new argument removes the oldest ones.. leaving you with the limit defined on |
|
@fhbash Sorry, I was not clear enough about the running kernel example. Current code does not exclude the currently running kernel from removal which (in case the currently running kernel is not the latest one) results in failures like this: I think dnf5 should remove only |
Adds --oldinstallonly flag to remove old installonly packages (e.g., kernels) that exceed the configured installonly_limit. Optional --limit parameter allows overriding the config value (must be >1 to keep newest installed version). Usage: dnf5 remove --oldinstallonly # Remove all old installonly pkgs dnf5 remove --oldinstallonly kernel # Remove old kernels only dnf5 remove --oldinstallonly --limit=2 # Keep only 2 newest versions Closes: rpm-software-management#762 Signed-off-by: Fellipe Henrique <[email protected]>
7ce6161 to
3d80771
Compare
|
@m-blaha I made the change to allow Now it's working as supposed to.. removing the old 2 versions, leaving the current one. |
|
What's expected behavior in case the running kernel is not the one with the highest version number? |
|
I guess it should depend on protect_running_kernel option value. |
|
That's an option. Do I understand correctly that you mean that the
|
|
Yes, that's what I meant. I did not know how DNF4 behaves. I described my expectation that protect_running_kernel works independently from install-only feature and that non-latest kernel is old not matter whether it is running. I think it would keep the code and a documentation simple. Of course there is a matter of compatibility which I did not take into account. I'm not strongly against DNF4 behavior. I only find it more complex and less intuitive. |
|
Thanks for your opinion. I'm also not convinced we need to replicate safer, but less intuitive dnf4 behavior. There is one use case that dnf4 implementation resolves well, though: "Hey, dnf, I need to free some disk space. Remove all unneeded kernels I have installed on my box". In this case "dnf4 remove --oldinstallonly" would keep the running kernel and the latest version (to be used after reboot) and remove everything else, which I find useful. Some links: |
Adds
--oldinstallonlyflag to remove old installonly packages (e.g., kernels) that exceed the configured installonly_limit.Optional
--limitparameter allows overriding the config value (must be >1 to keep newest installed version).Usage:
ci-tests: rpm-software-management/ci-dnf-stack#1782
Closes: #762