Clean up extra startup items for Ubuntu

Source: Internet
Author: User

Original source: Http://hi.baidu.com/iceliushuai/item/f43a0c2ecf04e50e72863e19


Ubuntu has been used for a long time, installing a lot of kernels, and when you start the system, there will be a lot of entries, most of which are not necessary if your system is working properly.

For example, I have never used the two entries of recovery mode and memtest86+.

1. Clean up the excess kernel

Aptitude Search Linux-image # Find image

shily@hh-desktop:~$ Aptitude Search Linux-image # Find image P Linux-image                                  
-Generic Linux kernel image.                                                                     
V linux-image-2.6- I linux-image-2.6.38-10-generic-linux kernel image fo                                      R version 2.6.38 on x86/x86_64 p linux-image-2.6.38-10-generic-pae -Linux kernel image for version 2.6.38 on x86 p linux-image-2.6.38-10-                             
Virtual-linux kernel image for version 2.6.38 on x86/x86_64 I A linux-image-2.6.38-11-generic-linux kernel image for version 2.6. X86/x86_64 P Linux-image-2.6.38-11-generic-pae-linux kernel image for version 2.6.38 on x86 P Linux-image-2.6.38-11-virtual-linux kernel image for version 2.                                           6.38 on x86/x86_64 P linux-image-2.6.38-8-generic                                       -Linux kernel image for version 2.6.38 on x86/x86_64 p linux-image-2.6.38-8-generic-pae   -Linux kernel image for version 2.6.38 on x86 p Linux-image-2.6.38-8-virtual-linux kernel image for version 2.6.38 on x86/x8 6_64 P Linux-image-2.6.38-9-generic-linux Kerne                                       L image for version 2.6.38 on x86/x86_64 p linux-image-2.6.38-9-generic-pae - Linux kernel image for version 2.6.38 on x86 p linux-image-2.6.38-9-virtual   -Linux kernel image for version 2.6.38 on x86/x86_64 i                                                      
Linux-image-generic-generic Linux kernel image  P Linux-image-generic-pae-generic Linux                                                     Kernel image P Linux-image-server                                         
-Linux kernel image on Server equipment.    P Linux-image-virtual-linux kernel image for virtual machines


Aptitude Search Linux-image | grep ^i # Find installed image

shily@hh-desktop:~$ Aptitude Search Linux-image | grep ^i  # Find installed image
I   linux-image-2.6.38-10-generic                                          -Linux kernel image for version 2.6.38 on x86/ x86_64      
i A linux-image-2.6.38-11-generic   -Linux kernel image for version 2.6.38 on x
i   Linux-image-generic             


UNAME-R # Determine which image is currently in use

shily@hh-desktop:~$ uname-r  # Determine which image is currently in use
2.6.38-11-generic


sudo aptitude remove linux-image-2.6.38-10-generic linux-image-2.6.38-11-generic # Remove excess image, multiple spaces can be separated

shily@hh-desktop:~$ sudo aptitude remove linux-image-2.6.38-10-generic  # Delete superfluous image

In addition, you can also use Ubuntu Tweek to clean the kernel, and install the way you want.

2. Prohibit recovery mode option

This is really no use, if necessary, you can modify the normal startup items, add a single parameter, usually do not need to see it every time.

Read /etc/grub.d/10_linux will find that a variable is checked before adding the RECOVERY option:grub_disable_recovery

So set this variable and use root to edit /etc/default/grub

Remove the # number before the grub_disable_recovery= "true":

--/etc/default/grub.old    2013-03-26 10:38:13.000000000 +0800
+++/etc/default/grub    2013-03-22 14:37:33.000000000
+0800 @@ -28,7 +28,7 @@ -28,7
 =true
    
 # uncomment to DISABLE generation of Recovery Mode menu Entries
-#GRUB_DISABLE_RECOVERY = "true"
+grub_disable_recovery= "true"
    
 # Uncomment To get a beep at grub start
 #GRUB_INIT_TUNE = "480 440 1"

Update configuration file after modification

shily@hh-desktop:~$ sudo update-grub

Looking again at /boot/grub/grub.cfg will find that there are no recovery related entries.

3. Disable the memtest86+ option to remove the executable properties of the/etc/grub.d/20_memtest86+ file

sudo chmod-x/etc/grub.d/20_memtest86+
sudo update-grub


Warning:

1, the operation is in danger, please back up the original file first.

2, be sure to confirm that the/boot/grub/grub.cfg file format is normal before restarting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.