[Translation] four methods to clean up Linux disk space

Source: Internet
Author: User
4 methods to clean Up Linux Disk Space 4 WaystoFreeUpDiskSpaceonLinuxhtt 4 methods to clean Up Linux Disk Space 4 Ways to Free Up Disk Space on Linux http://www.howtogeek.com/185173/4-ways-to-free-up-disk-space-on-linux/

Recently, I 've been bored with all sorts of things. I saw this article about how-to geek, but I have been paying attention to this issue before. so I want to translate it. if it is published, it means there are no pitfalls.
It's just about playing and practicing english. if translation errors or other problems occur, leave a message. For more information, see the source and translator.

Linux hard disks are not as lightweight as they can. For example, after you install the software, the APT package manager saves the package files, which is a waste of space unless you plan to uninstall or reinstall them.

We have already introduced how to clean up disk space on Windows and disk space on Mac. Many tricks are similar-delete temporary files, analyze hard disk usage, and view the space occupied by the application.

Delete temporary files

BleachBit is almost a CCleaner on Linux. It can scan out unused temporary files on your computer and automatically delete them to clear the space. It can find the cache, browsing history, and temporary files on the computer. You can install BleachBit in the Ubuntu Software Center.

Remember, if you do not use the root permission to open it, this tool cannot delete APT software packages and other system-level things. You can run sudo bleachbit on a terminal as root. (We have removed the gksu command from Ubuntu)Related reading: differences between ubuntu sudo and gksu

BleachBit's best feature is its ability to automatically execute common things that only have experienced Linuxe users. For example, execute the autoclean, autoremove, and clean commands for APT software packages that you do not need, and delete the cached software package files that have been installed. You don't need the software package files that have been downloaded-this is just like you don't need to save the installation program after installing the software in Windows. Although it is unlikely that you may need to reinstall some files, the APT software package will be reinstalled at this time.

Analyze hard disk usage

Ubuntu comes with an overview of directories and files that scan your system and display the largest space. When you clean up the space, this will be very helpful-do you forget a virtual machine or other large files in your home directory? This tool can find them and intuitively display the space they occupy.

This tool also comes with the Disk Usage analysis (Disk Usage Analyzer) to open it. If you are using a non-Ubuntu Linux branch, it may also come with it because it is part of GNOME. If you cannot find it, try to install the Baobab package. (Sudo apt-get install baobab)

View the space occupied by the application

The application you installed-the application installed in the form of a software package-also occupies space on your hard disk. If you have installed many applications, they may occupy a lot of space. To determine how much space each package occupies, we can use the Synaptic package manager. It was previously part of Ubuntu, but was removed to free up space for other tools. You can go to the Ubuntu Software Center to find and install Synaptic. (You can also use the sudo apt-get install synaptic command)

If you use the deb-based branch of Debian, you can also use synaptic. If not, you may need to use different package management tools.

Check which package occupies the maximum space. select Status> Installed to view the list of packages you have Installed. Next, click Size column to sort the list by the package Size. (If you cannot see the Size column, click Settings> Preferences and select the Size column under Columns and Fonts pages. You can also move it to the top of the list, and the column will be displayed on the leftmost .)

Of course, this does not mean that you can uninstall a software package because it occupies a lot of space. Some software packages are the key to system operation, such as the Linux kernel. However, we can see that software packages such as LibreOffice, Firefox, and Thunderbird occupy a lot of space in them-if our space is really tight and we seldom use these software, you can unload them to release space. We can reinstall them later.

Delete old kernel

Ubuntu will save the old Linux kernel after installing the new kernel version. Under the boot item directory displayed during startup, you can choose to start the program to enter the old kernel. When something in the new Linux kernel is corrupted, you can go back to the old kernel -- but if
The new kernel works normally, and those old kernels only occupy space.

Note: Before deleting any kernel files, make sure that you have restarted the new kernel after installing it, instead of using the old kernel. Ubuntu is automatically started back to enter the latest kernel, but if you haven't restarted after kernel update,
You will still be using the old kernel.

Using the Synaptic software package management tool to delete the old Linux kernel is very simple. Use Ctrl + F in Synaptic to tell it the file name you want to search for linux --- yes, there is a broken number. Then sort by the package name, and you can see the approximate packages at the front-end of the list.

Authorization = ">

Remember that we have several different versions of linux-image-extra, linux-headers, and linux-software packages. We can delete the old versions of these software packages-each kernel has multiple different software packages associated with it.
Select the old version, right-click it, and mark it as removal ). Then, the space can be released as long as the application is modified.

Remember-only delete old kernel files! Leave the latest version or your system will not be able to start. For example, in the image below, we will leave version 3.11.0-18 and remove version 3.11.0-12 and 3.11.0-15.
. Based on the data displayed by Synaptic, we can release MB space after removing these two kernels.

If you operate on the Linux service, you can also clear or reduce some large log files to free up space. If an application generates a large number of log files that you don't need, you can modify its configuration so that it can only record the most important events to save space.

Related Article

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.