Monday 24 February 2020

Wash my Bash

An effective title to explain my personal script to clean and obtain free space on my personal disk.
I want to show you all this script to delete something annoying:

df -h
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get purge `deborphan`
df -h


This script is composed of 4 parts in turn composed of as many commands:

  • autoremove 1: the autoremove option removes packages that were automatically installed because some other package required them but, with those other packages removed, they are no longer needed;
  • autoclean 2:clears the local repository of retrieved package files, but it only removes files that can no longer be downloaded and are virtually useless. It helps to keep your cache from growing too large;
  • clean 3: clears out the local repository of retrieved package files.It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/;
  • purge `deborphan` 4: To delete unnecessary libraries

1 https://www.networkworld.com/article/3453032/cleaning-up-with-apt-get.html
2 https://www.networkworld.com/article/3453032/cleaning-up-with-apt-get.html
3 https://askubuntu.com/questions/894736/what-is-sudo-apt-get-clean
4 https://sites.google.com/site/easytipsforlinux/using-deborphan