Development > Linux Lite Software Development

Lite Tweaks - Suggestions welcomed

<< < (44/45) > >>

anon222:
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
--- End code ---

Jerry:
Thanks folks, keep'm coming, some good ones there already :)

anon222:
There should be an option to remove old kernels.
I guess these are already in the script.

--- Code: ---sudo apt-get autoclean
--- End code ---

--- Code: ---sudo apt-get clean
--- End code ---

--- Code: ---sudo apt-get autoremove
--- End code ---

Maybe clearing thumbnail cache

--- Code: --- rm -f ~/.cache/thumbnails/normal/*
--- End code ---
Purging unused configuration files

--- Code: ---sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)
--- End code ---
Trash cleanup

--- Code: ---rm -r -f ~/.local/share/Trash/files/*
--- End code ---
Browser cache cleanup, would also be usefull.

Alex:
When I was in windows (last week) I used a free program called CCleaner it seemed to do the job quite well and had/has a number of functions from cleaning to registry checking to uninstalling unwanted progs and their components. I don't know how much of that sort of thing would apply to LL. but something similar might be good.

:)

rokytnji:
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: --- apt-get autoremove

--- End code ---


--- Code: --- deborphan | xargs apt-get -y remove
--- End code ---


--- Code: ---  COLUMNS=200 dpkg -l |grep ^rc |awk '{print $2} ' | xargs dpkg -P

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version