Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to clean up the Linux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to clean up the Linux system, the article is very detailed, has a certain reference value, interested friends must read it!

Unlike linux and windows systems, linux does not produce useless junk files, but linux does not delete these files automatically in the upgrade cache, which still takes up a lot of hard disk.

In order to provide better help for Xiaobai, the five methods provided by Linux Lab in this issue have high security, and you can rest assured to use them. At the same time, this article uses the Ubuntu16.04 system, but if you are using another version of Ubuntu or Linux Mint, you can follow the same steps.

Remove useless installation packages

In the previous Linux lab, the author introduced apt-get and its similar commands, while in the apt-get command, there is a "autoremove" automatic removal option. This option removes some useless automatic installation packages and libraries, as well as Linux kernels that are automatically installed during a system upgrade.

This is a silly command that you can run at any time to increase your disk free space.

Sudo apt-get autoremove

As you can see, this command frees up 300MB space on my computer.

Clear the APT cache in the system

APT, whose full name is Advanced Package Tool, is an advanced software package tool, and it is a mature software package management system. Ubuntu uses APT to install, manage, and uninstall software on the system, and after doing so, APT retains the previously downloaded and installed package cache.

APT caches the DEB package in / var/cache/apt/archives, and over time the cache becomes larger and larger and contains a large number of unwanted software installation packages. You can check your cache size with this command:

Sudo du-sh / var/cache/apt

As you can see, APT has a total of 581MB space in this system. When you have no space available, 500MB is already a very meaningful space.

Then you have two ways to clean up these caches, the former is automatically cleared by the system, and the latter command line can clear more space.

Sudo apt-get autocleansudo apt-get clean cleans thumbnail cache

For most systems with Linux as the kernel (including Android), there is thumbnail, which can be literally translated into "thumbnails", which means that Ubuntu automatically creates a version of thumbnails and stores them in the file manager. Generally speaking, such thumbnails are stored in a hidden directory located in ~ / .cache/thumbnails

Of course, over time, the number of thumbnails will increase greatly, and the files inside will become larger and larger. If you want to know the size of your thumbnail, you can use this command to see that the system currently has a 380MB cache.

Du-sh ~ / .cache/thumbnails

Then you can clean your cache at any time, and the quickest way is to use the clean command on the terminal:

Rm-rf ~ / .cache / thumbnails/* uninstall less commonly used software

There is always software we download as soon as we are excited about it, but we don't need it once half a year after downloading. For these and take up computer resources, the best way to uninstall them is to uninstall them.

If you need to uninstall these infrequently used software and know the name of the software, you can use the following command to uninstall it.

Sudo apt-get remove package-name1 package-name2 cleans up Ubuntu space through GUI

The above methods can be said to clean up disk space on the command line, and some people may not be used to this. After all, you need to remember all the commands and use them one after another, so here is a recommended way to clean up memory space through GUI. Linux Lab: five moves to clear the Linux system Space

For example, Stacer is such a tool, it can display your system memory, CPU and other parts status information, of course, there are many other similar tools, waiting for you to explore.

The above is all the contents of the article "how to clean up the Linux system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report