In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "Linux system how to clean disk space", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux system how to clean disk space" this article.
1. Remove packages that are no longer needed if you know the detailed usage of the apt-get or apt command, you should know the autoremove option. This option removes dependent libraries and packages that are automatically installed when you install a package, which are usually useless in the system and only waste disk space. Of course, the autoremove option can also automatically delete old and useless Linux kernels that have been replaced during a system upgrade.
This is an automated stupid command that you can use to free up some free hard disk space for your Ubuntu system from time to time:
Sudo apt autoremove as shown in the following figure, China Merchants Bank can release 315MB disk space for my system after this order.
two。 Clean up the APT cache in Ubuntu Ubuntu uses APT (an advanced package tool) to install, remove, and manage software on the system, and it retains the cache of previously downloaded and installed packages after the software is uninstalled.
The APT package management system caches downloaded DEB packages in the / var/cache/apt/archives file, and the cache directory can grow considerably over time due to a large number of unwanted packages.
You can view the size of this cache using the following command:
Sudo du-sh / var/cache/apt as you can see, I have more cache stores than 90MB. When you have almost no disk space left, this 90MB space can be released to save the emergency.
We have two options for cleaning up the APT cache, one of which is to delete only outdated packages:
The other type of sudo apt autoclean is to clean up the entire cache (free up more disk space):
Sudo apt clean3. Clean up the thumbnail cache to make it easier for the user to preview the picture, Ubuntu automatically creates a thumbnail for the image file to view in the file manager, and these thumbnails are actually hidden and stored in the ~ / .thumbnail directory of the user account as a file.
If you are a photography enthusiast or a picture collector, the number of thumbnails will increase greatly over time. It is particularly important to note that if you delete some photos or pictures, the automatically generated thumbnail cache will still exist on disk and will not be automatically erased.
You can check the size of the thumbnail cache using the following command:
Du-sh ~ / .cache/thumbnails
Therefore, it is a good habit to clear the thumbnail cache every few months or so. The quickest way is to use terminal commands:
Rm-rf ~ / cache/thumbnails/*4. Manual removal of Old Linux Kernel (Professional) the first method mentioned earlier is that you can automatically delete old and useless Linux Kernel, but if you have manually installed the kernel in Ubuntu, the apt autoremove command option does not apply. However, deleting older kernels that are not in use does save a lot of disk space, so you can manually uninstall Ubuntu kernels that are manually installed.
First, use the following command to list all installed Linux Kernel in the current Ubuntu:
Sudo dpkg-- list 'linux-image*'* removes the old kernel just like any other software package:
Sudo apt remove linux-image-VERSION, please replace the above VERSION with the kernel version to be cleared. System geeks recommend keeping at least two or three of the latest kernel versions, so that there are at least a few alternatives if the latest kernel cannot be used to boot the system.
5. Remove redundant orphaned packages (Professional) first let's talk about what orphaned packages (also called redundant packages) are in the Ubuntu system: suppose you install a package called myprogram, which in turn relies on the mylib library, which is usually automatically installed on the system when myprogram is installed. When you uninstall the myprogram application, the mylib library may still remain in the system. In this case, the mylib becomes an orphaned package.
Gtkorphan, a graphical application, can easily find and delete orphaned packages in Ubuntu systems, and first install them using the following terminal commands:
After sudo apt install gtkorphan is installed, you can find and delete orphaned packages in the "redundant packages" tab.
To be honest, this option is not recommended unless you really want to squeeze out the free space per MB of the current system.
6. Uninstall unnecessary applications I believe that everyone has one and several games or applications that are rarely used in the system. Don't believe it? Go to your Ubuntu system and check the software list. In fact, I don't need to say much about this, if you need more disk space, it's always a good idea to delete applications that are never used or rarely used.
To delete the software, you can use "Ubuntu Software" or direct terminal commands:
Sudo apt remove package name 7. Use GUI tools to free up Ubuntu space if you really think the content of this article is too troublesome, and do not like to use these commands and tools, then I recommend a centralized cleaning Ubuntu system gadget, you can learn how to use the Stacer cleanup tool in Ubuntu.
The above is all the contents of the article "how to clean disk space in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.