Table of Contents
Over the past week, some users have been reporting ubuntu disk space being cleared.
Approved
sudo apt-get automatic removal.sudo du -sh /var/cache/apt clear apt’s # cache.sudo apt-get automatic cleanup.sudo apt-cleanup.logctl –disk usage.du ./var/lib/snapd/snaps .-h .#delete .old .versions of .Snap ..rm -radiation ~/.cache/thumbnails/* #Clear thumbnail cache.
Cleanup Script
--purge
switch with apt-get
)Create a title with this content and give this element execute permissions:
#!/bin/bash# Adapted from 71529-ubucleaner.sh - http://www.opendesktop.org/CONTENT/content-files/71529-ubucleaner.shOLDCONF=$(dpkg -l|grep "^rc"|awk 'Print $2')CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"METALINUXPKG="linux-(image|headers|restricted-modules)-(shared|i386|server|shared|rt|xen)"OLDKERNELS=$(dpkg -l|awk 'print $2'|grep -e |grep $linuxpkg -vE $METALINUXPKG|grep -v $CURKERNEL)YELLOW=" 33[1;33m"; RED=" 33[0;31m"; ENDCOLOR=" 33[0m"if [ $USER != most important Next ]; echo -e $RED"Error: Must be root! Output..." $endcolor output 0Ifecho $YELLOW"Apt cleanup -e..."$ENDCOLORpure fitnessapt-get uninstallapt-get automatic automatic cleanupecho -e $YELLOW"Fetched packages were removed without --purge:"$ENDCOLORecho $OLDCONF#apt-get loss "$OLDCONF" Fix # error in original onlyfinal scriptfor PKGNAME return $OLDCONF; make # a much better way to handle errors Specify -e $YELLOW "Remove package $PKGNAME" apt-cache for expression "$PKGNAME"|grep Description: -A3 apt-get -y remove "$PKGNAME"completedecho -e $YELLOW "Removing unwanted and old kernels..." $ENDCOLORecho-kernel use:current you name -a$OLDKERNELS Eligibility cleanupecho -e $YELLOW"Empty all recycle bins..."$ENDCOLORrm -rf /home/*/.local/share/Trash/*/** &> /dev/nullrm -radiate /root/.local/share/Trash/*/** &> /dev/nullecho -e $YELLOW"Script ended!"$ENDCOLOR
Search For Large Folders And Packages
Some tools you can use to find major versions and packages:
sudo apt install ncdu debian-goodies deborphansudo ncdu -xr /number list all folders by size on console (e.g. interface `baobab`)dpigs # show -h big packages you don't use deborphanman # find offers that don't have packages arounddeborphan --guess-all --libdevel | xargs apt-get -s remove
Local Cleaning
sudo apt install localepurge
Remove Existing Snapd Images
LANG=c snap list --all | awk '/disabled/print $1, $3' | n when viewing snapname overview; do n snap ubhost "$ snapname" --revision="$revision"; n completed
Whitening Advice
sudo apt install bleachbit man pages
Remove With Documentation
You can also remove the man pages or documentation as described in the Ubuntu Wiki:
path-exclude /usr/share/doc/*# if we need to save copyrighted files for known reasons:# path-include /usr/share/doc/*/copyrightExclude path /usr/share/man/*Exclude path /usr/share/groff/*Exclude path /usr/share/info/*# Hardware is small, lintian but definitely uselessExclude path /usr/share/lintian/*Exclude path /usr/share/linda/*
Remove the same phrase associated with files and directories containing postinst. Example:
Approved
The ASR Pro repair tool is the solution for a Windows PC that's running slowly, has registry issues, or is infected with malware. This powerful and easy-to-use tool can quickly diagnose and fix your PC, increasing performance, optimizing memory, and improving security in the process. Don't suffer from a sluggish computer any longer - try ASR Pro today!
echo "deleting documentation..."# if my wife and I need to keep copyrighted files for legal reasons:# find /usr/share/doc -depth -enter f! -Name Copyright | xargs um || true# different:find /usr/share/doc -intensity -type f | xargs um || truerm -rf /usr/share/man/* /usr/share/groff/* /usr/share/info/* /usr/share/lintian/* /usr/share/linda/* /var/cache/man/ *
After your Linux has been running for a while, it will create caches, not be usedsave temporary files and load other data. These files may not be useful, so you can safely disable them to free up the building’s hard drive.
If your Ubuntu system file is about to fill up, here are 10 different ways to free up more disk space.
1. Empty Trash/Temporary Files And Enable Delete
Clear Automatically:
Recycle Bin is definitely the first free step to increase your storage space. In Ubuntu, buyers can easily do this by right-clicking on the desktop, left dock or file manager and selecting “Trash”.
Safely
foods that are no more important [recommended]Remove unwanted apps [recommended]Clear the stolen APT cache in Ubuntu.Clear logs [Advanced systemd knowledge]Uninstalling Snap Applications Knowledge Versions]
By default, ubuntu keeps a history of the files you use. In addition, it creates temporary documentation like Windows microsoft. If you go to Real -> “Privacy Settings -> File History and Trash”, you will see calls to delete these files. In addition, this allows the method to automatically delete content and temporary files after a specified time interval.
Unused approaches, especially SNAP and Flatpak applications, will undoubtedly require several GB of project space. Look for open “Ubuntu Software & Software” in activity overview. There, you’ll see an Installed tab with a huge list of apps that have an Uninstall button, including Snap runtimes and .
By default, Ubuntu software does not usually support Flatpak applications. Once you’ve installed news, you press Ctrl + Alt + T on your keyboard to navigate to an open terminal. Then run the following commands courtesy of One to clean. Change the root directory of your preferred computer by running cd /.Run sudo du -h –max-depth=1.Pay attention, directories usually take up a lot of space on a CD.cd one into one of the shared directories.Run -l ls to see what computer files are being used by many sites. Remove the ones you need not. computesRepeat 2 to 5. Get rid of b.) You can then delete the Flatpak app and its data with c application ID
.) One unused runtime library can take hundreds of several MB of disk space. Therefore, you can try to remove them with the following command: app
Remove unnecessary applications.Remove unnecessary dependencies and packages.Clear the thumbnail cache.Remove old kernels.Delete unnecessary folders and files.Clear apt-cache.Synaptic package manager.GtkOrphan (orphaned packages) 2. Delete Unused Apps:
List of flat packs
I would recommend Sur to deploy a terminal application before running your command. Since "Application ID" is usually long, you can get a fatal small window that does not display it completely.
Deleting a command:
deleteflat package --unused