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 > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to free up the space of the Linux operating system. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
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.
2 Clean the APT cache in Ubuntu
Ubuntu uses APT (the 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:
Sudo apt autoclean
The other is to clean up the entire cache (freeing up more disk space):
Sudo apt clean
3. Clean up the thumbnail cache
To make it easier for users to preview pictures, Ubuntu automatically creates a thumbnail for the image file to view in the file manager, and these thumbnails are actually hidden in the file form and stored in the ~ /. Cache/thumbnails directory of the user's account.
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. Manually delete the old Linux kernel (professional)
In the previous introduction to method 1, it was mentioned 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 is not applicable. 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*'*
Deleting an older kernel is the same as deleting 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 * * versions of kernels, so that there are at least several alternative emergencies when the system cannot be booted using the * * kernel.
5. Delete redundant orphaned packages (professional)
First of all, let's talk about what are orphaned packages (also known as redundant packages) in Ubuntu systems: suppose you install a package called myprogram, which in turn relies on the mylib library, which is usually automatically installed into the system when you install myprogram. 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:
Sudo apt install gtkorphan
After installation, 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
It is believed 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 the GUI tool to free up Ubuntu space
If you really find the content of this article too troublesome and don't like to use these commands and tools, then I recommend a gadget that centrally cleans up the Ubuntu system, through which you can learn how to use the Stacer cleanup tool in Ubuntu.
Thank you for reading! This is the end of the article on "how to release Linux operating system space". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.