How do I remove old kernel versions to clean up the boot menu?


Question: I have upgraded the kernel on my Ubuntu many times in the past. Now I would like to uninstall unused old kernel images to save some disk space. What is the easiest way to uninstall earlier versions of the Linux kernel on Ubuntu?

In Ubuntu environment, there are several ways for the kernel to get upgraded. On Ubuntu desktop, Software Updater allows you to check for and update to the latest kernel on a daily basis. On Ubuntu server, the unattended-upgrades package takes care of upgrading the kernel automatically as part of important security updates. Otherwise, you can manually upgrade the kernel using apt-get or aptitude command.

Over time, this ongoing kernel upgrade will leave you with a number of unused old kernel images accumulated on your system, wasting disk space. Each kernel image and associated modules/header files occupy 200-400MB of disk space, and so wasted space from unused kernel images will quickly add up.

GRUB boot manager...

0 0
0 0

HOWTO: Remove Older Kernels via GUI (or CLI)

When new kernels are introduced and installed the older kernels remain in the system. They are located in the /boot folder and are displayed in the Grub menu. Over time, unless the older kernels are removed, the Grub menu will continue to expand, as will the space occupied in the /boot folder.

Should the user wish to remove one or more older kernels there are several ways to do so. Physically removing a kernel from the OS will also remove it from the Grub 2 menu once the Grub menu is updated with the "update-grub" command. Another method is to manually edit the Grub 2 scripts to display only an assigned number of kernels (even if more kernels are retained in /boot).

Note: Users should consider keeping a known, working older kernel. This provides insurance in case the user experiences problems with a newly-introduced kernel. The older kernel will be displayed on the Grub 2 menu as long as it remains in the /boot...

0 0

LVM installs and encrypted installs use a small separate /boot partition. The small partition is capable of holding only four or five kernels, and fills to capacity quickly. To prevent /boot partition from getting full, you need to configure automatic removing of old kernels, or remove old kernels regularly manually, since automatic removing of old kernels is not enabled by default; see Bug #1357093.

Changing the kernel-containing packages on your system requires commands with root access, so please do read RootSudo.

Removing old kernels is easy to do on a properly-operating system. You can do it manually, or set unattended-upgrades to do it automatically. If you are receiving package management errors, regular maintenance may not work until the problem is fixed. See Problems below.

Manual Maintenance

If your system is operating without error, you should be able to remove old kernels with a simple autoremove command in shell:

sudo apt-get...
0 0

I install the earliest possible ALPHA version of every different Ubuntu as soon as they come out.

Consequently, gobs of old kernel versions pile up during the development process. There is no easy way to remove them. The following URL "How do I remove or hide old kernel versions to clean up the boot menu?" ( provides some guidance, but there should be a better way.

Aptitude can be used to install the new versions of the kernel - so it kinda makes sense that it could also be used to remove them. Not just remove the packages, but uninstall them from boot menu...

0 0

Each time Ubuntu installs a new Linux kernel (upgrade), it leaves the old one installed. It means if you update/upgrade regularly, the Grub boot menu will be filled with all the Linux kernels you installed on your system, even those you no longer need. Btw, this is done purposely to make sure that you can boot to a previous kernel in case you have problems with the new installed kernel. However, if the new kernel works for you, you can uninstall and remove the older kernels to clean up the Grub boot menu. Today, I’m gonna show you how to remove old Ubuntu kernels.

In older versions of Ubuntu you can just open a terminal or hit Alt+F2 and type in this command: gksu gedit /boot/grub/menu.lst. The thing is, in newer versions of Ubuntu (9.4+) the menu.lst file was replaced by /boot/grub/grub.cfg which is a read-only file and is not supposed to be edited, making that solution obsolete.

The best and safest way to clean up the Grub boot menu is to use the Synaptic Package...

0 0

My custom boot menu and, in particular, the latest Linux kernel (Version 2.6.32-29), are working just fine and so it’s time to clean up my system. In particular, I can now remove all the old Linux kernels that are not in use and which are just taking up space on the hard disk.

By doing so, these outdated kernels will no longer be included in any GRUB2 update, and hence won’t clutter up the listings on the boot menu. I can then simplify my custom boot set-up and, hopefully, prepare it to function more-or-less automatically next time a new kernel is downloaded.

The web is full of advice on how to remove old Linux kernels, including the use of some graphical utility programs. My preference is to list the kernels currently installed on my system, identify those that are no longer required, and use the Synaptic Package Manager to remove these.

In the previous posting, we saw a command that lists all the installed kernels, namely:

dpkg --list | grep...
0 0

Back to the home page

First of all:


use cleaning applications like BleachBit! Those software wrecking balls are very risky and may

damage your system beyond repair

. There are a few safe cleaning actions, which I'll describe below.

Ubuntu doesn't get polluted much over time (with one notable exception, namely old kernels. More about that later). It even doesn't need defragmentation. The only cleansing actions you might want to do in Ubuntu, are the following:

Clear the updates cache

1. Use the application Software (the paper shopping bag icon in the desktop bar) to install Synaptic Package Manager.

Then click on the grey Ubuntu logo (Dash home). Query: synaptic.
Click on Synaptic Package Manager

Settings - Preferences - Files

Put the dot at: Delete downloaded packages after installation

Press the button: Delete cached package files

Clear the thumbnail cache

2. For each shown...

0 0

Remove Old Kernel Entries

The most common clean up task for the boot menu is to remove old kernel versions lying around on your machine.

In our case we want to remove the 2.6.35-23-generic and 2.6.35-22-generic boot menu entries. In the past, this meant opening up /boot/grub/menu.lst…but with Grub2, if we remove the kernel package from our computer, Grub automatically removes those options.

To remove old kernel versions, open up Synaptic Package Manager, found in the Applications > Administration menu.

When it opens up, type the kernel version that you want to remove in the Quick search text field. The first few numbers should suffice.

For each of the entries associated with the old kernel (e.g. linux-headers-2.6.35-23 and linux-image-2.6.35-23-generic), right-click and choose Mark for Complete Removal.

Click the Apply button in the toolbar and then Apply in the summary window that pops up. Close...

0 0

How to clean up and edit the Ubuntu Grub2 boot loader menu differs quite a bit from previous versions. As Ubuntu nominated the new version 2 of the Grub boot manager as of 9.10, so they did away wit the old and problematic menu.lst file.

Grub2 boot loader is a leap forward in many ways, and most of the annoyances from menu.lst are gone. Yet, if you don’t clean up old versions of kernel entries, the boot list can quickly get messy and end up in a long list of nonsense. Let’s assume we want to remove the 2.6.32-21-generic boot menu entries. Previously, this meant editing /boot/grub/menu.lst. But with Grub2, we use the package manager to remove the kernel package from our computer, Grub automatically removes those options. Btw. if only one operating system is installed on your computer, you may not see the boot menu at all and have to hold down the SHIFT button on your keyboard while booting up to get the menu to show.

Using Synaptic Package Manager

To remove...

0 0

If you’ve using Ubuntu for a period of time, you may have old kernels that are no longer useful on your system. It may be annoying to have these kernel entries in Grub boot menu. So here’s how to remove the old kernels in Ubuntu 13.10 Saucy, Ubuntu 13.04 Raring.

The efficient way to do the job is using the Ubuntu Tweak, which lists all un-used kernels and gives an option at right-bottom corner to clean them up.

To install Ubuntu Tweak, download the DEB package in the right sidebar of this page. Then double-click to install via Ubuntu Software Center.

At the moment, Ubuntu Tweak is not ready for Ubuntu 13.10 Saucy. So below is the command line way:

1.) Press Ctrl+Alt+T to open terminal for running commands. Check current running kernel version.

uname -r

Don’t remove this kernel!

2.) Copy and paste below command and hit run to check list of installed Kernels on your system:

dpkg --list | grep linux-image

3.) Find out the...

0 0

GRUB2 and its display of all kernels

The latest versions of Grub2 installed in Ubuntu automatically display the latest kernel and hides the older kernels that you may have installed.

If you do not see your grub - then remember to press Shift whilst booting.

As you can see, only the latest kernel is displayed.

If you select the option shown (press Enter) then all the old kernels become visible and available to boot from.

How to permanently delete older kernels

First boot with the latest available kernel.

There are a number of ways to delete old kernels. Personally, I wouldn't touch Computer Janitor since this is acknowledged to break your computer with its suggestions.


An alternative is Synaptic (sudo apt-get install synaptic)

search for linux-image, right-click a kernel and choose complete removal and finally click the Apply button to delete the kernel.

Repeat the...

0 0

Is there a reason why Ubuntu wont do this automatically?

I can see only 1 reason: it does not work flawlessly; there is no clean way to currently decide what the definition of "old kernels" is. "old" does not mean "unused" nor does it mean "unwanted". And any mistake in this will kill a users' machine.

So up to now the manual method is preferred since this puts the power of removing into the users' hands.

Resources for this conclusion:

Ubuntu WIKI: Proposal for removing old kernels

Last-good-boot is implemented fully in Intrepid/8.10 final, however it has been disabled because it was not considered stable enough. The setting is a single line in the file /etc/default/kernel-helper-rc.

Launchpad: Should aptitude provide a way to remove old kernel versions ?

apt-get has an autoremove feature that uninstalls all packages that are not needed as dependencies and have not been installed manually. Since Ubuntu 14.04 all obsolete...

0 0

Ubuntu adopted the new version of the Grub boot manager in version 9.10, getting rid of the old problematic menu.lst. Today we look at how to change the boot menu options in Grub2.

Grub2 is a step forward in a lot of ways, and most of the annoying menu.lst issues from the past are gone. Still, if you’re not vigilant with removing old versions of the kernel, the boot list can still end up being longer than it needs to be.

Note: You may have to hold the SHIFT button on your keyboard while booting up to get this menu to show. If only one operating system is installed on your computer, it may load it automatically without displaying this menu.

Remove Old Kernel Entries

The most common clean up task for the boot menu is to remove old kernel versions lying around on your machine.

In our case we want to remove the 2.6.32-21-generic boot menu entries. In the past, this meant opening up /boot/grub/menu.lst…but with Grub2, if we remove the kernel...

0 0

First, there is a tool for listing all big folders and files. Just type 'Baobab' into the launcher. By removing folders and files you don't need you get more space.

Then, there is a program for removing double files. The program is called fslint. Install it by entering

sudo apt-get install fslint

in a Terminal.

or graphically

You can also clear the package cache with

sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove

The fourth step is to remove old Kernel entries. You can do this by installing and opening Synaptic. In Synaptic, search for the old Kernel entries (every Kernel entry that is displayed in GRUB except the newest) and remove it.

One good step is to remove the application cache. Do this by installing and running bleachbit:

sudo apt-get install bleachbit

or graphically

Important: Deleted cache cannot be restored!

The last step is to defragment the file system. Do the following...

0 0

One question that shows up almost every day in the Ask Leo! inbox is how to remove malware.

Every day.

The scenarios differ, but the problem is the same: a machine has been infected with spyware, a virus, or some other form of malware, and that machine’s owner is having a tough time getting rid of it.

And it often happens with anti-malware software installed that “should” have taken care of it before it got to this stage.

Hopefully, that’ll never be you. If it is, let’s review the steps I recommend for removing malware and reducing the chances it’ll happen again.

A word about prevention

If there’s only one thing I would have you take away from this article, it would be this:

As we’ll see in a moment, the steps to remove malware can be painful and time consuming. While it might seem like work, knowing how to stay safe on the internet is much, much easier in comparison.

So, let’s look at what to do when prevention has...

0 0

Linux Mint is one of the top free operating systems widely used in the world and currently receives the highest hits at DistroWatch.

Even though it's an Ubuntu-based system, Linux Mint features only one panel at the bottom which looks closer to the taskbar in the Windows system, and a well-organized start menu complete with a useful Search box. It also pre-installs some proprietary software, including the Adobe Flash plugin and necessary media codecs, by default so that you can view streaming media, such as YouTube videos in a browser, and play mp3, mp4 or most other media files with a player right away out of the box.

If you have the Linux Mint system which comes with the default Gnome-2 desktop environment installed in your PC, you might find these tips and tricks useful for working with the system.

Note: The steps described in this article work best with Linux Mint 11 and Linux Mint 10. If you're using Linux Mint 13 Maya or newer versions, please check out...

0 0
This is a collection of some of the more frequently asked questions about Busybox. Some of the questions even have answers. If you have additions/corrections to this document, we would love to add them.

General questions

What is Busybox? How can I get started using Busybox? How do I configure Busybox? How do I build Busybox with a cross-compiler? How do I build a Busybox-based system? Which Linux kernel versions are supported? Which architectures does Busybox run on? Which C libraries are supported? Where can I find other small utilities since Busybox does not include the features I want? I demand that you to add right now! How come you don't answer all my questions on the mailing list instantly? I demand that you help me with all of my problems Right Now! I need help with Busybox! What should I do? I need you to add ! Are the Busybox developers willing to be paid in order to fix bugs or add in ? Are you willing to provide support contracts? Can I include Busybox as part of...
0 0
Linux kernel release 3.x These are the release notes for Linux version 3. Read them carefully, as they tell you what this is all about, explain how to install the kernel, and what to do if something goes wrong. WHAT IS LINUX? Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance. It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6. It is distributed under the GNU General Public License - see the accompanying COPYING file for more details. ON WHAT HARDWARE DOES IT RUN? Although originally developed first for 32-bit x86-based PCs (386 or higher), today Linux also runs on (at least) the Compaq Alpha AXP, Sun...
0 0