Article Title: linux disk space cleanup. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Tip 1: Clear the remaining configuration files.
Generally, after a software is deleted from the Ubuntu system, the residual configuration file of the software is not deleted. If you are sure that you will not use the software in the future, it is unnecessary to keep its configuration file, so we can delete it together.
To delete the residual configuration file of a software, perform the following operations:
Run sudo synaptic on the terminal to start the Synaptic package management tool.
Click the Status button in the lower-right corner of Synaptic to switch.
Now, you should be able to see Not installed (residual config) on the left side of Synaptic ). Select it to see the package containing the residual configuration file on the right. You can delete the package here.
Tip 2: Clear the downloaded cache package
When we install software through sudo apt-get install in Ubuntu, all downloaded packages are cached in the/var/cache/apt/archives/directory. To clear these downloaded cache packages, run the following command:
Sudo apt-get autoclean
Sudo apt-get clean
Tip 3: Clear unnecessary packages
We know that when installing software in Ubuntu, the dependencies of the software are usually automatically installed. After we delete the software, we may need to manually delete its dependencies. You can run the sudo apt-get autoremove command to solve this problem.
Tip 4: Clear useless language files
Like other Linux distributions, Ubuntu is a system that supports multilingual interfaces. In fact, for us who use their own native language, we usually need to retain Chinese. You can also retain the language you need, such as English. Other language files do not need to be retained for us.
To clear these useless language files, you need to install a tool named localepurge In the Ubuntu system.
Installing localepurge is very simple. You only need to execute the sudo aptitude install localepurge command. During the installation process, the program will prompt you to enter the screen shown in for configuration.
Localepurge
You can use the space key to select the region configuration to be retained, and delete other configurations. This tool will also be automatically executed when you install the program later. Do not configure it again. Chinese users retain zh, zh_CN, zh_CN .*
Tip 5: Clear useless translation content
You can use the trans-purge tool to clear useless translation content in *. desktop, mime-database, and gconf schema.
The use of trans-purge is as follows:
Download source code:
Wget http://pcman.sayya.org/desktop-purge.c
Wget http://pcman.sayya.org/mime-purge.c
Wget http://pcman.sayya.org/gconf-purge.c
Install the compilation dependency:
Sudo apt-get install libglib2.0-dev
Compile the program:
Gcc 'pkg-config glib-2.0 -- cflags -- libs'-o desktop-purge desktop-purge.c
Gcc 'pkg-config glib-2.0 -- cflags -- libs'-o mime-purge mime-purge.c
Gcc 'pkg-config glib-2.0 -- cflags -- libs'-o gconf-purge gconf-purge.c
Installer:
Sudo cp desktop-purge/usr/bin/
Sudo cp mime-purge/usr/bin/
Sudo cp gconf-purge/usr/bin/
Execute cleanup:
Manual cleaning:
Sudo desktop-purge
Sudo mime-purge
Sudo gconf-purge
Automatic Cleaning:
Let apt-get automatically clean up after installing the software. Create the/etc/apt. conf. d/99-transpurge file and add the following content:
DPkg
{
Post-Invoke {"if [$ (ps w-p" $ PPID "| grep-c remove )! = 1]; then/usr/bin/desktop-purge>/dev/null;/usr/bin/mime-purge>/dev/null; /usr/bin/gconf-purge>/dev/null; else exit 0; fi ";};
};
Warning useless translation cannot be restored after being cleared. if the system is damaged after use, the author is not responsible.