The summary of garbage cleaning method under Linux __linux

Source: Internet
Author: User
Tags delete cache

Linux does not produce unwanted junk files, but Linux does not automatically delete these files in the upgrade cache, or it takes up a hard drive.

One, delete cache

1, a very useful cleanup command:
sudo apt-get AutoClean cleans up older versions of the software cache
sudo apt-get clean cleans up all software caches
sudo apt-get autoremove remove orphaned software that the system no longer uses
These three commands primarily clean up the upgrade cache and the unwanted packets.

2, clean up the cached files of opera Firefox:
LS ~/.opera/cache4
LS ~/.mozilla/firefox/*.default/cache

3, clean Linux under the orphaned packets:
At the end of the command we can use:
sudo apt-get install deborphan-y

4, Uninstall: Tracker
This thing generally I just install Ubuntu will be the first delete tracker he will not only produce a large number of cache files, but also affect the boot speed. Again the Software Center deletes.

Appendix:
Temporary files directory for package management:
Package in
/var/cache/apt/archives
Did not download the finished in
/var/cache/apt/archives/partial

Second, delete software

The removal of Ubuntu software is generally done with the Ubuntu Software Center or the "new", but sometimes it seems to be quicker and better to use commands.
sudo apt-get remove--purge software name
sudo apt-get autoremove remove orphaned software that the system no longer uses
sudo apt-get AutoClean cleans up older versions of the software cache
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p clear residual configuration files

Keep it clean.

Third, remove the excess kernel

1, first Use this command to view the kernel used by the current Ubuntu system
Uname-a

2, and then look at all the kernels
Dpkg--get-selections|grep Linux

3, and finally remove it carefully.
sudo apt-get remove linux-image-2.6.32-22-generic

Ps:linux-image-xxxxxx-generic is the kernel version to be deleted
And also
Linux-headers-xxxxxx
Linux-headers-xxxxxx-generic in short the middle has "xxxxxx" that section of the old core can be deleted, pay attention to the general selection of the core number of smaller deletion

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.