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