Posts: 1,255
Threads: 21
Joined: Aug 2014
Reputation:
0
What? Like Bleachbit? Personally. I am too much of a control freak to trust a autocleaner.
Hope you don't mind what I post. If so I will modify and delete
Remove unwanted junk.
Code:
deborphan | xargs apt-get -y remove
Code:
COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P
LL 3.6,2.8
Dell XT2 > Touchscreen Laptop
Dell 755 > Desktop
Acer 150 > Desktop
I am who I am. Your approval is not needed.
Posts: 688
Threads: 49
Joined: Jul 2014
There should be an option to remove old kernels.
I guess these are already in the script.
Code:
sudo apt-get autoclean
Code:
sudo apt-get autoremove
Maybe clearing thumbnail cache
Code:
rm -f ~/.cache/thumbnails/normal/*
Purging unused configuration files
Code:
sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
Trash cleanup
Code:
rm -r -f ~/.local/share/Trash/files/*
Browser cache cleanup, would also be usefull.
Posts: 688
Threads: 49
Joined: Jul 2014
I've found this 7 year old, yet very interesting script called "Ubucleaner" License: GPL
It might help you.
Code:
#!/bin/bash
OLDCONF=$(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)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
if [ $USER != root ]; then
echo -e $RED"Error: must be root"
echo -e $YELLOW"Exiting..."$ENDCOLOR
exit 0
fi
echo -e $YELLOW"Cleaning apt cache..."$ENDCOLOR
aptitude clean
echo -e $YELLOW"Removing old config files..."$ENDCOLOR
sudo aptitude purge $OLDCONF
echo -e $YELLOW"Removing old kernels..."$ENDCOLOR
sudo aptitude purge $OLDKERNELS
echo -e $YELLOW"Emptying every trashes..."$ENDCOLOR
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
echo -e $YELLOW"Script Finished!"$ENDCOLOR
Posts: 688
Threads: 49
Joined: Jul 2014
(09-05-2014, 10:16 AM)Valtam link Wrote: So far ...
I like it.
May I see the code? I have a few ideas.
Posts: 656
Threads: 106
Joined: Feb 2014
Reputation:
0
This will be great for those of us like me who dread the Terminal. :-[
Left Mac OS X for Linux in Jan 2014