samedi 9 mars 2013

#Nettoyage #Ubuntu

Genre de paquets a virer :

apt-get remove --purge lilypond-doc aspell-en aptitude-doc-en ubuntu-docs hunspell-en-us abiword link-grammar-dictionaries-en gnumeric xchat texlive-latex-base-doc example-content language-pack-en-base language-pack-gnome-en-base language-pack-en-base language-pack-gnome-en language-pack-en aspell-en myspell-en-gb example-content tomboy language-pack-bn language-pack-bn-base language-pack-de language-pack-de-base language-pack-es language-pack-es-base language-pack-gnome-bn language-pack-gnome-bn-base language-pack-gnome-de language-pack-gnome-de-base language-pack-gnome-es language-pack-gnome-es-base language-pack-gnome-pt language-pack-gnome-pt-base language-pack-gnome-xh language-pack-gnome-xh-base language-pack-pt language-pack-pt-base language-pack-xh language-pack-xh-base

apt-get remove fonts-horai-umefont fonts-unfonts-core fonts-tlwg* fonts-nanum fonts-takao-pgothic ttf-wqy-microhei

- Rechercher avec Synaptic les thermes suivants :
-en -gb -de -es -pt -doc

Plus simple : utiliser ' BLEACHBIT '

Lister les paquets qui prennent le plus de place :
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'

Script de Nettoyage:
#!/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 trash..."$ENDCOLOR
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
  
echo -e $YELLOW"Script Finished!"$ENDCOLOR

Ne garder que le noyau Linux en cours d utilisation

Pour savoir quel 'kernel' est en cours d utilisation taper la commande :
uname -r

paquets qui nécessitent une validation / accord

sun-java googleearth hot-babe jackd

Logiciel pour voir ce qui prend le + de place

sudo apt-get install ncdu)
ncdu -r $HOME --exclude $HOME/.snapshot

Aucun commentaire:

Enregistrer un commentaire

Archives du blog