Clear Ubuntu junk and startup items

Source: Internet
Author: User
Ubuntu version: 9.10 first, with apt-get installation/uninstall software systems, a lot of pull files will be generated, not only the site space but also the performance will be affected. Second, updates to the Ubuntu kernel will also generate multiple old kernels that are no longer in use and will cause the startup Item to constantly increase how to clean these files. In fact, you can use apt-get In Ubuntu to basically achieve this, the following is a brief description of how to clean up (part of the content refer to the self-Network) 1. Clean up the pull sudoapt-getauto generated after installation/uninstallation

Ubuntu version: 9.10

First, as apt-get installs/uninstalls software systems, many pull files will be generated, which not only affect the disk space, but also the performance;

Second, updates to the Ubuntu kernel will also generate multiple old kernels that are no longer in use and will lead to an increasing number of startup items.

How to clean these files can be basically done using apt-get In Ubuntu. The following describes how to clean up the files (for some content, refer to self-network)

1. Clear the pull volumes generated after installation/uninstallation.

Sudo apt-get autoremove // automatically unmount unused content

Sudo apt-get autoclean // automatic cleanup, but temporary files downloaded for installation are not deleted

Sudo apt-get clean // clear the downloaded temporary file

Note the system prompts when using the above commands. Common problems are: (1) The last time apt-get was used for installation or uninstallation, apt-get cannot be used, at this time, the system will prompt you to enter some commands to solve the problem first and then continue (the command is generally sudo apt-get update); (2) other background programs in the system are being installed, upgraded, or uninstalled, you need to wait until the preceding command is completed (it is better to restart the system and use the above command)

2. Clear Ubuntu startup items

Uname-a // view the currently used Kernel

Dpkg -- get-selections | grep linux // list all software with linux, mainly to list the kernel

Sudo apt-get remove linux-headers-2.6.31-X-XX // uninstall the old kernel, where X represents the version, whichever is actually listed in the system

Sudo apt-get remove linux-image-2.6.31-XX-XX

The excess kernel is uninstalled, and the latest kernel is always retained. In Ubuntu9.10, the start item is automatically deleted, but we need to manually clean up the start item in earlier versions, because grub is used in ubuntu9.04 or earlier, and you need to edit the menu. lst (sudo gedit/boot/grub/menu. (lst), but in ubuntu9.10, It is upgraded to grub2, so even if you want to manually modify it, it is not editing the menu. lst edits grub. cfg file.

Sudo chmod + w/boot/grub. cfg // The default file is read-only and can be read/written. You do not need to perform the following steps to manually modify the file.

Sudo gedit/boot/grub. cfg // modify the startup Item and delete the content that is no longer in use.

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.