Option to remove old kernels

We obviously have a different way of helping others. I prefer the polite way.

1 Like

well… english is not my language, but I help everyday people in english… I helped Jim and I’m quite sure I was not unpolite…

moreover, Jim seems grown enough to defend himself.

anyway, as usual, you’re free to think what you want and welcome when you express your thoughts

I had totally missed this answer, where there’s the right information.

Now I have a doubt… the information is in the dnf.conf or somewhere (cause of SME/NS)?
I’m at work and can’t verify by myself, now

The option is inside /etc/yum.conf and it’s called installonly_limit.

1 Like

Becuse learning is always the best way to improve our knowlege:

1 Like

Did I need to reboot?
Because now I have a bunch of 6 kernel :fearful:

Finally to clean to system… I had to install yun-utils

# yum install yum-utils

and clean up

# package-cleanup --oldkernels --count=2

1 Like

@Jim you can also make a custom template for yum.conf file :slight_smile: in order not to delete old kernels by your own.

I’m curious to know why this parameter don’t work…

This e-smith layer… Let’s talk about it :camel:

It works!

it Indeed keeps 5 kernels

But I put it at 2…
And NS keep 6 Kernels

Jim

@Jim

cat /etc/yum.conf
installonly_limit=5

[root@host1 etc]# ll /boot | grep -c vmli
5

The option doesn’t clean up old kernels on a running system, but it will be used by yum only when a new kernel is installed.

Example:

  • installonly_limit = 2
  • you have 5 kernels installed
  • CentOS releases a new kernel, and you execute yum update
  • at the end of the process you will have only 2 kernels installed

When I found this parameter, I was thinking exactly as you describe @giacomo…
But the reality is different, to be clear, see the exact timeline:
- I had 5 kernels, and the installonly_limit = 5 ( before I
changed )
- I change installonly_limit = 2 … And waited ( still with 5
kernels )
- Past thuesday or friday, there’s a kernel update… I expected
to see only 2 kernels, but I found 6 kernels.!!! :OMG:

What’s happened?
Now I had two kernel because I made a manual cleanup.

When there’s an update by the CenterSoftware, the parameter installonly_limit = 2 seem to be ignored…

It seems you’re right, from man yum.conf:smile:

installonly_limit Number of packages listed in installonlypkgs to keep installed at the same time. Setting to 0 disables this
feature. Default is ’3’. Note that this functionality used to be in the ā€œinstallonlynā€ plugin, where this option was altered via
tokeep. Note that as of version 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If
that attribute is ā€œkeepā€, then they will never be removed.

What can be do to improve?

-It’s a bug in the softwarecenter?
-A missing feature?

  • a plugin that not work as expected?
  • an e-smith surprise (@nas :stuck_out_tongue_winking_eye:)?

installonly_limit=2
I’l try to test this

Today, there’s a kernel update…
I setup to have only two kernels…
But it seem that’s wrong yet.

Edit What’s happen?

In the yum.comf the installonly_limit=5

There’s something that erase my yum.conf to erame my value.

I would like to know what.
Is there a way to fix this?

It’ a template.

To create a template custom:

mkdir -p /etc/e-smith/templates-custom/etc/yum.conf/
cp /etc/e-smith/templates/etc/yum.conf/10base /etc/e-smith/templates-custom/etc/yum.conf/

Edit the file and execute:

expand-template /etc/yum.conf