1/3/2024 0 Comments Ubuntu clean disk space![]() ![]() This option shows the amount of disk space available in kilobytes (K), megabytes (M), and gigabytes (G). You can use the -h option to make the output easier to read. By default, the df output shows the usage in KB. The first thing you'll need to do is know the location of your ext4.vhdx. Using the df command The df command can be used to view the available disk space for each drive on the Linux system. WSL will automatically grow the virtual disk (ext4.vhdx), but shrinking it to reclaim unused space is something that must currently be done manually. The default value is 3 for several revisions for retention. 5 Answers Sorted by: 68 There's a WSL Github issue open on this topic. That means Snap keeps three older versions of each package, including the active version. How to free up disk space in Ubuntu and Linux Mint 1. This is okay if you do not have constraints on your disk space.īut for servers and other use cases, this can easily run into cost issues, consuming your disk space. Uninstall the application with the following command: sudo apt remove application name. Here’s a dry run (simulation) of what the apt-get clean command deletes: There is another command that deals with cleaning the apt cache: sudo apt-get autoclean. This will remove the content of the /var/cache/apt/archives directory (except the lock file). Installing Ubuntu 20.04 on a Clean Disk Drive There are now three ways in which an Ubuntu system can be deployed. Simply use the apt-get command with clean as argument: sudo apt-get clean. Get rid of packages that are no longer required Recommended. One method is to either purchase new hardware or re-purpose an existing computer system on which to install and run the operating system. If you read the apt-get commands guide, you might have. Uninstall unnecessary applications Recommended. Basically, create a new file named clean-snap.sh and add the following lines to it. We all have a few games and/or applications that we hardly use. If not, then you could empty the log files. If there are user data, move that out first. See here to find out what is taking the place. sudo snap set system refresh.retain=2 Clean Up Snap Versions However, you can easily modify the count using the following command. 1 Answer Sorted by: 3 The trick will be to try to release a minimum of space, so that apt-get can work again. In a post in SuperUser, Popey, the ex-Engineering Manager at Canonical, provided a simple script that can clean up old versions of Snaps and keep the latest one. Snap remove "$snapname" -revision="$revision" LANG=en_US.UTF-8 snap list -all | awk '/disabled/' | Here’s the script we will use to clean the Snap up. The system Cleaner section gives you the option to search for and clean potentially unnecessary files of four types: Apt Cache: If you read our guide to apt-get commands, you already know that every time you install packages with the apt command, the downloaded package files are cached. sh in a directory (for example clean_snap.sh), give it executable permission and run. Check the box System - Wipe Free Disk Space. ![]() ![]() When I ran the script, it reduced a lot of disk space. The script would also show the name of the package being removed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |