linux-tips.us Open in urlscan Pro
45.63.67.181  Public Scan

URL: https://linux-tips.us/remove-unused-kernels-from-rhel/
Submission: On October 29 via api from US — Scanned from US

Form analysis 5 forms found in the DOM

POST

<form id="noptin-form-1" class="noptin-optin-form noptin-form-single-line noptin-label-hide" method="post" novalidate="">
  <div class="noptin-form-header noptin-img-right">
    <div class="noptin-form-header-text">
      <div style="color: #FAFAFA;font-size: 30px;font-weight: 700;line-height: 1.5;" class="noptin-form-heading">Subscribe to Newsletter!</div>
      <div style="color: #fafafa;font-size: 16px; font-weight: 500; line-height: 1.3;" class="noptin-form-description">Get notified when new articles are published!<div>We promise to never share your email!</div>
      </div>
    </div>
    <div class="noptin-form-header-image">
      <img data-lazyloaded="1" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" decoding="async" alt="icon" data-src="https://cdn.noptin.com/templates/images/email-icon.png">
    </div>
  </div>
  <div class="noptin-form-footer">
    <div class="noptin-form-fields">
      <div class="noptin-form-field-wrapper noptin-form-field-email noptin-optin-field-wrapper noptin-optin-field-email" id="noptin-form-1__field-email--wrapper">
        <div class="noptin-field-email">
          <label class="noptin-label" for="noptin-form-1__field-email">Email Address</label>
          <input name="noptin_fields[email]" id="noptin-form-1__field-email" type="email" value="" class="noptin-text noptin-form-field noptin-form-field__has-no-placeholder" placeholder="Email Address">
        </div>
      </div>
      <div class="noptin-form-field-wrapper noptin-form-field-submit noptin-optin-field-wrapper noptin-optin-field-submit">
        <input type="submit" id="noptin-form-1__submit" class="noptin-form-submit btn button btn-primary button-primary wp-element-button" name="noptin-submit" value="Subscribe Now!" style="background-color: #FAFAFA;color: #313131;">
      </div>
    </div>
    <div class="noptin-form-notice noptin-response" role="alert"></div>
  </div>
  <input type="hidden" name="noptin_element_id" value="1"><input type="hidden" name="source" value="225"><input type="hidden" name="form_action" value="subscribe"><input type="hidden" name="noptin-config" value="zMi2WDZXQA0nv6Pdns0byw--"><input
    type="hidden" name="noptin_form_id" value="225"><input type="hidden" name="noptin_nonce" value="c1c81c4073"><input type="hidden" name="conversion_page" value="https://linux-tips.us/remove-unused-kernels-from-rhel/"><input type="hidden"
    name="action" value="noptin_process_ajax_subscriber"><input type="hidden" name="noptin_process_request" value="1"><input type="hidden" name="noptin_timestamp" value="1730231365"><input type="hidden" name="noptin_submitted"
    value="1730231365"><label for="noptin_zviwhygc6" style="display: none;">Leave this field empty</label><input type="text" id="noptin_zviwhygc6" name="noptin_ign" autocomplete="off" aria-hidden="true" tabindex="-1"
    style="position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0px; width: 0px; z-index: -1;">
</form>

POST https://linux-tips.us/wp-comments-post.php

<form action="https://linux-tips.us/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate="">
  <p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> <span class="required-field-message">Required fields are marked <span class="required">*</span></span></p>
  <p class="comment-form-comment"><label for="comment">Comment <span class="required">*</span></label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required=""></textarea></p>
  <p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" autocomplete="name" required=""></p>
  <p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="email" value="" size="30" maxlength="100" aria-describedby="email-notes" autocomplete="email" required=""></p>
  <p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="url" value="" size="30" maxlength="200" autocomplete="url"></p>
  <p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"> <label for="wp-comment-cookies-consent">Save my name, email, and website in this browser for the next time
      I comment.</label></p>
  <span class="cerber-form-marker"></span>
  <div data-size="invisible" class="g-recaptcha" data-sitekey="6LdcKq0aAAAAAPrHcMG3cscAO-Zds7i59UajMhqY" data-callback="now_submit_the_form" id="cerber-recaptcha" data-badge="bottomright">
    <div class="grecaptcha-badge" data-style="bottomright" style="width: 256px; height: 60px; display: block; transition: right 0.3s; position: fixed; bottom: 14px; right: -186px; box-shadow: gray 0px 0px 5px; border-radius: 2px; overflow: hidden;">
      <div class="grecaptcha-logo"><iframe title="reCAPTCHA" width="256" height="60" role="presentation" name="a-x8j0gxsbo20w" frameborder="0" scrolling="no"
          sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox allow-storage-access-by-user-activation"
          src="https://www.google.com/recaptcha/api2/anchor?ar=1&amp;k=6LdcKq0aAAAAAPrHcMG3cscAO-Zds7i59UajMhqY&amp;co=aHR0cHM6Ly9saW51eC10aXBzLnVzOjQ0Mw..&amp;hl=en&amp;v=-ZG7BC9TxCVEbzIO2m429usb&amp;size=invisible&amp;badge=bottomright&amp;cb=lpuy2bb793pv"></iframe>
      </div>
      <div class="grecaptcha-error"></div><textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response"
        style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea>
    </div><iframe style="display: none;"></iframe>
  </div><!-- Noptin Newsletters - https://noptin.com/ -->
  <p class="noptin_comment_form_optin_checkbox_wrapper"> <label class="noptin-integration-subscription-checkbox noptin-integration-subscription-checkbox-comment_form">
      <input type="checkbox" name="noptin-subscribe" value="1">
      <span>Subscribe To Our Newsletter</span>
    </label>
  </p><!-- / Noptin Newsletters -->
  <p class="form-submit"></p>
  <div class="stcr-form">
    <p class="comment-form-subscriptions"><label for="subscribe-reloaded"><select name="subscribe-reloaded" id="subscribe-reloaded">
          <option value="none">Don't subscribe</option>
          <option value="yes">All new comments</option>
          <option value="replies">Replies to my comments</option>
        </select> Notify me of followup comments via e-mail. You can also <a href="https://linux-tips.us/comment-subscriptions/?srp=4019&amp;srk=39272085ad2a6761291fc07a85f4d8a1&amp;sra=s&amp;srsrc=f">subscribe</a> without commenting.</label></p>
  </div><input name="submit" type="submit" id="submit" class="submit" value="Post Comment"> <input type="hidden" name="comment_post_ID" value="4019" id="comment_post_ID">
  <input type="hidden" name="comment_parent" id="comment_parent" value="0">
  <p></p>
  <p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="2041295126"></p>
  <style type="text/css">
    .stcr-hidden {
      display: none !important;
    }
  </style>
  <p style="display: none !important;" class="akismet-fields-container" data-prefix="ak_"><label>Δ<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_1" name="ak_js"
      value="1730231365311">
    <script>
      document.getElementById("ak_js_1").setAttribute("value", (new Date()).getTime());
    </script>
  </p>
  <div id="altEmail_container" class="altEmail_container"><label for="alt_s">Alternative:</label><input type="text" id="alt_s" name="alt_s"></div><span class="wpa_hidden_field" style="display:none;height:0;width:0;"><label>WPA <input type="text"
        name="gbpyww6035" value="108728"></label></span>
</form>

GET https://linux-tips.us/

<form role="search" method="get" class="search-form" action="https://linux-tips.us/">
  <label>
    <span class="screen-reader-text"> Search for: </span>
    <input type="search" class="search-field" placeholder="Search …" value="" name="s">
  </label>
  <button type="submit" class="search-submit"><span class="screen-reader-text"> Search </span></button>
</form>

POST https://www.paypal.com/cgi-bin/webscr

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
  <div class="paypal-donations">
    <input type="hidden" name="cmd" value="_donations">
    <input type="hidden" name="bn" value="TipsandTricks_SP">
    <input type="hidden" name="business" value="uninvolved@outlook.com">
    <input type="hidden" name="return" value="https://linux-tips.us/donations/">
    <input type="hidden" name="rm" value="0">
    <input type="hidden" name="currency_code" value="USD">
    <input type="image" style="cursor: pointer;" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online.">
    <img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
  </div>
</form>

POST

<form id="noptin-form-2" class="noptin-optin-form noptin-form-new-line noptin-label-hide" method="post" novalidate="">
  <div class="noptin-form-header no-image">
    <div class="noptin-form-header-text">
      <div style="color: #191919;font-size: 30px;font-weight: 700;line-height: 1.5;" class="noptin-form-heading">Subscribe To Our Newsletter</div>
      <div style="color: #666666;font-size: 16px; font-weight: 500; line-height: 1.3;" class="noptin-form-description">Get notified when new articles are published! It's free and I won't send you any spam.</div>
    </div>
  </div>
  <div class="noptin-form-footer">
    <div class="noptin-form-fields">
      <div class="noptin-form-field-wrapper noptin-form-field-email noptin-optin-field-wrapper noptin-optin-field-email" id="noptin-form-2__field-email--wrapper">
        <div class="noptin-field-email">
          <label class="noptin-label" for="noptin-form-2__field-email">Email Address</label>
          <input name="noptin_fields[email]" id="noptin-form-2__field-email" type="email" value="" class="noptin-text noptin-form-field noptin-form-field__has-no-placeholder" placeholder="Email Address">
        </div>
      </div>
      <div class="noptin-form-field-wrapper noptin-form-field-submit noptin-optin-field-wrapper noptin-optin-field-submit">
        <input type="submit" id="noptin-form-2__submit" class="noptin-form-submit btn button btn-primary button-primary wp-element-button noptin-form-button-block" name="noptin-submit" value="Subscribe Now"
          style="background-color: #009688;color: #fefefe;">
      </div>
    </div>
    <div style="color: #607D8B;font-size: 14px;font-weight: 400;line-height: 1;" class="noptin-form-note">.</div>
    <div class="noptin-form-notice noptin-response" role="alert"></div>
  </div>
  <input type="hidden" name="noptin_element_id" value="2"><input type="hidden" name="source" value="57"><input type="hidden" name="form_action" value="subscribe"><input type="hidden" name="noptin-config" value="7NGfTeSpWBK_m6rg4oHtpw--"><input
    type="hidden" name="noptin_form_id" value="57"><input type="hidden" name="noptin_nonce" value="c1c81c4073"><input type="hidden" name="conversion_page" value="https://linux-tips.us/remove-unused-kernels-from-rhel/"><input type="hidden"
    name="action" value="noptin_process_ajax_subscriber"><input type="hidden" name="noptin_process_request" value="1"><input type="hidden" name="noptin_timestamp" value="1730231365"><input type="hidden" name="noptin_submitted"
    value="1730231365"><label for="noptin_yft3qh19k" style="display: none;">Leave this field empty</label><input type="text" id="noptin_yft3qh19k" name="noptin_ign" autocomplete="off" aria-hidden="true" tabindex="-1"
    style="position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0px; width: 0px; z-index: -1;">
</form>

Text Content

Skip to content

Linux Tips

Getting you up to speed!

Menu
 * Sponsorship
 * Index
 * Important Pages
 * Contact Meexpand child menu
   * About Me
   * Contribute
   * Donations
 * Privacy Policy


REMOVE UNUSED KERNELS FROM RHEL

FlipboardRedditFacebookTwitterPocketTumblrPinterestWhatsAppShare

Today’s article is only going to apply to some of you, specifically those who
use RHEL and want to remove unused kernels from RHEL. That’s a pretty narrow
subset of people, but it’s worth knowing this information if you’re a RHEL user.

Red Hat is one of the oldest Linux distributions out there. Along the way,
they’ve turned into an ‘enterprise’ (business class) distro. They’ve made some
strange strategic decisions lately, but I’m not going to get into that in this
article.

As an enterprise distro, it is not entirely free (as in cost in dollars). They
are a distro that has a great deal of support for long periods. They’re meant to
be stable and ideal for business use. You’re expected to pay for RHEL – sort of.

RHEL has a free version if you sign up as a developer. You can learn about the
RHEL developer program at this link. I thought it was free for a few devices,
but it looks like I might be wrong and that it may be more than that. From the
linked page:

> An entitlement to register 16 physical or virtual nodes running Red Hat
> Enterprise Linux.

So, that’s more than three – but you’re not going to get support. If you want to
go this route, you’re expected to support yourself. Fortunately, RHEL has
extensive documentation and your dev subscription will get you access to any of
that documentation that’s behind a paywall. Or, at least that’s my experience.

I don’t do enough with RHEL!

LINUX KERNELS:

I’ve explained what the kernel is before. Linux is just the kernel. We add stuff
to the kernel to make an operating system. We then add more stuff to make it a
specialized operating system – such as a desktop operating system, like the
readers of this site use.

Along the way, as you update and upgrade, you’ll add new kernels. These are not
necessarily removed by default. They can take up quite a bit of space and you
might be paying for that space (especially if you’re using RHEL as a server
somewhere). So, removing the oldest kernels is just good housekeeping.

That’s all we’re doing in this article. I suppose it’d probably also work for
CentOS but I don’t pay any attention to that distro these days. It’s not that
I’m angry or annoyed with RHEL’s decisions, it’s that I only care for things
with long-term support. I’m old and changes scare me!

We’re just going to clean up any old kernels, probably while keeping the 2 most
recent kernels, to keep things nice and orderly. This isn’t something you
technically have to do. You can keep all the kernels you want. But, if you want
to remove unused kernels from RHEL this might be the article for you!


REMOVE UNUSED KERNELS FROM RHEL:

Now, if you’re using RHEL as a server then you’re already connected via SSH
(probably) and already have a terminal open. If you’re using RHEL as a desktop
OS, you will need to open a terminal. You can just press CTRL + ALT + T and your
terminal will pop open.

With your terminal open, you first need to install yum-utils. That’s nice and
easy, just use this command:

yum install yum-utils
1
yum install yum-utils

(You’ll need elevated permissions unless you’re logged in as root.)

Next, run the following command to see how many kernels you have installed:

rpm -q kernel
1
rpm -q kernel

If you have more than two kernels installed, you can run this command:

package-cleanup --oldkernels --count=2
1
package-cleanup --oldkernels --count=2

You can adjust that command if you’d like. That particular command will keep the
kernel you are currently using and the previous kernel. (You can boot to older
kernels via GRUB if you want. That article is actually about recovery mode on
Ubuntu, but the pictures should clue you in until I write an article just for
this purpose.)

If you use a --count= of 1 or 0, it will remove every kernel except the one in
use, it will not remove the kernel that’s in use.

That’s all you have to do. There’s nothing more to it. The command will
automatically remove older kernels at the level you decided. You can keep the
most recent three kernels, four kernels, or however many kernels you want. It’s
not terribly complex.


CLOSURE:

I don’t do a whole lot of RHEL articles, but it’s nice to at least write one
here and there. If you’ve got extra kernels, you now know how to remove unused
kernels from RHEL. It’s a pretty easy task and something even a new user can
handle. If you’re a new user, go for it! It won’t break anything – in and of
itself. (I’d highly recommend keeping the current kernel and the most recent
kernel, just in case.)

Thanks for reading! If you want to help, or if the site has helped you, you can
donate, register to help, write an article, or buy inexpensive hosting to start
your site. If you scroll down, you can sign up for the newsletter, vote for the
article, and comment.

Subscribe to Newsletter!
Get notified when new articles are published!
We promise to never share your email!

Email Address


Leave this field empty


RELATED POSTS:

 1. Generate Random Numbers
 2. Who is, Simply whois
 3. Let’s Play Around With The Linux Shell.


AUTHOR: KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and
wise, but I am not infallible. Please point out any errors. And, as always,
thanks again for reading. View all posts by KGIII

Author KGIIIPosted on September 11, 2023September 10, 2023Categories General,
Software, TipsTags file management, kernels, RHEL


ONE THOUGHT ON “REMOVE UNUSED KERNELS FROM RHEL”

 1. Justin says:
    September 11, 2023 at 22:27
    
    It is nice to see some Red Hat content now and then. We used Red Hat at my
    last employer. Some of us were able to use Linux on our desktops.
    
    Reply


LEAVE A REPLY CANCEL REPLY

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Save my name, email, and website in this browser for the next time I comment.



Subscribe To Our Newsletter



Don't subscribe All new comments Replies to my comments Notify me of followup
comments via e-mail. You can also subscribe without commenting.





Δ

Alternative:
WPA


POST NAVIGATION

Previous Previous post: Let’s Make The rm Command Even Safer
Next Next post: Monitor Bandwidth In Real Time


TRANSLATE

Afrikaans Albanian Amharic Arabic Armenian Azerbaijani Basque Belarusian Bengali
Bosnian Bulgarian Catalan Cebuano Chichewa Chinese (Simplified) Chinese
(Traditional) Corsican Croatian Czech Danish Dutch English Esperanto Estonian
Filipino Finnish French Frisian Galician Georgian German Greek Gujarati Haitian
Creole Hausa Hawaiian Hebrew Hindi Hmong Hungarian Icelandic Igbo Indonesian
Irish Italian Japanese Javanese Kannada Kazakh Khmer Korean Kurdish (Kurmanji)
Kyrgyz Lao Latin Latvian Lithuanian Luxembourgish Macedonian Malagasy Malay
Malayalam Maltese Maori Marathi Mongolian Myanmar (Burmese) Nepali Norwegian
Pashto Persian Polish Portuguese Punjabi Romanian Russian Samoan Scottish Gaelic
Serbian Sesotho Shona Sindhi Sinhala Slovak Slovenian Somali Spanish Sundanese
Swahili Swedish Tajik Tamil Telugu Thai Turkish Ukrainian Urdu Uzbek Vietnamese
Welsh Xhosa Yiddish Yoruba Zulu
English


SEARCH

Search for: Search


DONATE




RECENT POSTS

 * Enable/Disable Your Network Interface
 * Check Your NIC Speed In The Terminal
 * Easily Monitor Your Wireless Connection
 * Count The Files In A Directory
 * Get System Information With The ‘uname’ Command In Linux


RECENT COMMENTS

 * Jamie on [Fixed] A Rambling Post About Switching To Linux
 * hwspeedy on hardinfo Has Been Rebooted As hardinfo2
 * KGIII on How To: Update OpenSUSE Tumbleweed From The Terminal
 * ich on How To: Update OpenSUSE Tumbleweed From The Terminal
 * KGIII on Install Python’s PIP Part One


LINKS

Register Login Cheap Web Hosting Article RSS Feed Privacy Policy


CATEGORIES

 * Audio/Video (11)
 * Command Line (385)
 * General (228)
 * Graphics (17)
 * Hardware (98)
 * History (33)
 * Meta (34)
 * Networking (83)
 * News (26)
 * Programming (4)
 * Reviews (15)
 * Security (69)
 * Server (24)
 * Software (171)
 * Tips (330)
 * Tutorials (159)
 * Tweaks (23)


ARCHIVES

 * June 2024
 * May 2024
 * April 2024
 * March 2024
 * February 2024
 * January 2024
 * December 2023
 * November 2023
 * October 2023
 * September 2023
 * August 2023
 * July 2023
 * June 2023
 * May 2023
 * April 2023
 * March 2023
 * February 2023
 * January 2023
 * December 2022
 * November 2022
 * October 2022
 * September 2022
 * August 2022
 * July 2022
 * June 2022
 * May 2022
 * April 2022
 * March 2022
 * February 2022
 * January 2022
 * December 2021
 * November 2021
 * October 2021
 * September 2021
 * August 2021
 * July 2021
 * June 2021
 * May 2021
 * April 2021

 * Sponsorship
 * Index
 * Important Pages
 * Contact Meexpand child menu
   * About Me
   * Contribute
   * Donations
 * Privacy Policy

Linux Tips Privacy Policy Proudly powered by WordPress
Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any
spam.
Email Address

.

Leave this field empty
×
Linux Tips
This work is licensed under a Creative Commons Attribution 4.0 International
License.
✓
Thanks for sharing!
AddToAny
More…