How to clean up trash for Ubuntu system

How to clean up trash for Ubuntu system

1. Clean up the downloaded software package
Ubuntu system will not produce useless garbage when it is running, but when we upgrade the system, the software package system downloaded by the software manager will not be cleaned up. For most users, once downloaded and installed After that, there is no need for the installation package to exist. Enter
in the terminal: du -h /var/cache/apt/archives
After pressing Enter we can see the space occupied by the installation package.
If you just want to delete the installation package that has been uninstalled, the command is: sudo apt-get autoclean
If you want to delete all the installation packages, the command is: sudo apt-get clean
There is another type of package, which has been uninstalled, but some packages that only depend on it and are not required for other packages. The package is still in the system, the delete command is:sudo apt-get autoremove

2. Delete unused old kernels
After updating the kernel, the old kernels are still in the system. If you are afraid of deleting them by mistake, you can enter in the terminal: uname -rcheck your kernel version.
The first step is to type in the terminal: dpkg --get-selections | grep linuxyou can see the kernel files in the system; the
second step, to type in the terminal: sudo apt-get purge 内核名/头文件名to delete the kernel files.

3. Clear the residual configuration files of the uninstalled software.
When uninstalling the software that we don't need, use sudo apt-get purge 软件名it as much as possible: In this way, the software and its configuration files can be uninstalled cleanly.
However, due to reasons such as this, some configuration files of uninstalled software are sometimes left in the system. If you want to remove these residual files, you can use a common software-Synaptic. You can process the residual configuration files of the software, and you can also manage the upgrade software package in the software.

* Special note: This method is suitable for a variety of Ubuntu and Debain Linux systems, such as Mint and Deepin Linux systems. *

Guess you like

Origin blog.csdn.net/weixin_44145894/article/details/105933235