Outils pour utilisateurs

Outils du site


issue118:tutoriel1

Ceci est une ancienne révision du document !


You just created a shiny new Linux system with all the bells and whistles? Happy to see your new babe giggle and dance, as you play with her? You want it to be the same way all the time? It is important to do some house-keeping once in a while. Over time, a computer system tends to get cluttered for many reasons. For example, software packages that are no longer needed can be uninstalled. When the system is upgraded from release to release, it may miss out on configuration tweaks that freshly installed systems get. Updating your system through the default updating tool will gradually cause the accumulation of packages and the filling of the cache. This can have a larger impact when you're uninstalling software packages, and their dependencies are left behind for no reason. Over the time, you could have a dozen copies of the same file lying in different corners of your system. The best place is to hunt them down and eliminate them before they take control of the hard disk.

Vous venez de créer un système Linux, tout nouveau, tout beau, avec toutes les fioritures ? Ça vous plaît de regarder votre nouvelle copine danser en rigolant pendant que vous jouer avec ? Vous voulez que ça dure ainsi à tout jamais ? Il est important de faire un peu de ménage de temps en temps.

Au fil du temps, un système informatique a tendance à s'encombrer de choses pour tout un tas de raisons. Par exemple les paquets logicielsqui ne sont plus nécessaire peuvent être déinstallés. Quand le système est mise à niveau de version en version, il peut ne pas profiter des ajustements de configuration que les systèmes nouvellement installés reçoivent. Des mises à jour faites avec le gestionnaire de mises à jour par défaut vont au fur et à mesure engendrer une accumulation des paquets et le remplissage du cache. Il peut y avoir encore plus d'impact quand vous désinstaller des paquets logiciel et que, pour aucune raison valable, leurs dépendances restent en place.

Au fil du temps, il pourrait y avoir une douzaine d'exemplaires du même fichier endormie dans divers coins de votre système. La meilleure chose à faire est de les chasser et les éliminer avant qu'ils ne prennent le contrôle de votre disque dur.

Occasional mishaps, like unexpected disk crashes, or unintentional power failures, may leave your disk with a lot of inaccessible fragments. A badly configured application may quietly chew up your disk, till there is no more free space left. Or, a runaway process or shell script may keep filling up your disk over and over again. The result could be a dramatic lockout for you. Linux offers an amazing collection of options for you to remove the cobwebs from your system. A health check for your disks The following will reveal a lot about potential health problems: sudo parted /dev/sda ‘print’ df -h You can take the following preventive measures to avoid disasters.

Des incidents occasionnels, comme des plantages de disque inattendus, ou des coupures d'électricité involontaires, peuvent laisser sur votre disque beaucoup de fragments inaccessibles.

Une application mal configurée peut, sans crier gare, ronger votre disque jusqu'à ce qu'il ne reste plus d'espace libre. Ou un processus ou script shell fou peut inlassablement remplir votre disque et vous pourriez retrouver votre disque complètement verrouillé.

Linux propose une collection époustouflante d'options qui vous permettront d'enlever les toiles d'araignées de votre système.

Une vérification de la santé de vos disks

La commande suivante révélera beaucoup sur des problèmes de santé éventuels :

sudo parted /dev/sda ‘print’

df -h

Vous pouvez prendre les mesures préventives suivantes pour éviter des catastrophes :

Call the professionals • Computer Janitor is an application to fix these kinds of problems. It attempts to find software packages that can be removed, and tweaks the system configuration in useful ways. • Do not use this program if you want to clean your system. All it does is remove packages it “thinks” are not necessary. For example, the interface of the Janitor doesn’t explain to a user what it intends to do. • Ubuntu Tweak is capable of a lot more than just system cleaning, but it is one aspect of the application that remains unsurpassed in terms of ease-of-use and features. Best of all, it doesn’t trash your system! • BleachBit quickly frees disk space, removes hidden junk, and easily guards your privacy. Erase cache, delete cookies, clear Internet history, remove unused localizations, shred logs, and delete temporary files.

Faites venir les pros

• Computer Janitor est une application qui sait réparer ce genre de problèmes. Elle essaie de trouver les paquets logiciel qui peuvent être enlevés et ajuste la configuration du système de plusieurs façons utiles. • N'utilisez pas ce programme si vous voulez nettoyer votre système. Tout ce qu'il fait, c'est d'enlever des paquets qu'il « pense » être inutiles. En fait, l'interface de Janitor n'expliquer même pas à l'utilisateur ce que le programme a l'intention de faire. • Ubuntu Tweak peut faire beaucoup plus que le ménage dans votre système, mais c'est l'un aspect de l'application qui reste inégalable pour ce qui concerne la facilité d'usage et les fonctionnalités. Surtout, il ne détruit pas votre système ! • BleachBit libère rapidement de l'espace disque, enlève les trucs « camelotes » cachés et veille sur votre vie privée. Il supprime le cache et les cookies, ainsi que l'historique de vote utilisation d'Internet, il enlève les emplacements inutilisés, broie les journaux et supprimes les fichiers temporaires.

Trusty ol’ terminal commands Read all the corresponding man pages before you use these tools. ncdu - ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don't have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple, and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed. The application can be run from any directory, including the root directory. The output will tell you the disk usage of each file and directory, with the ability to drill down into any listed directory. If you’re not familiar with it, ncdu is an ncurses interface for du, the tool used for estimating file space usage on Linux distributions. du is installed out-of-the-box, but ncdu is not, so if you wish to use it, first install it using the following commands: sudo apt-get update sudo apt-get install ncdu

Les bonnes et fidèles commandes du terminal

Lisez toutes les pages man correspondantes avant d'utiliser ces outils.

ncdu - ncdu analyse l'usage du disque et a une interface ncurses. Il est conçu pour trouver les consommateurs d'espace sur un serveur à distance où une interface graphique n'est pas disponible, mais, même sur un système standard d'ordinateur de bureau, c'est un outil utile. Ncdu se veut rapide, simple et facile à utiliser et devrait pouvoir se lancer dans tout environnement minimal de type POSIX où ncurses est installé. L'application peut être exécuter à partir de n'importe quel répertoire, y compris le répertoire root. La sortie de la commande vous indiquera l'utilisation disque de chaque fichier et dossier, avec les capacités de forage des données dans tout dossier énuméré.

Si vous ne le connaissez pas, ncdu est l'interface ncurses pour du, l'outil utilisé pour l'estimation de l'utilisation d'espace des fichiers sur les distributions Linux. du s'installe immédiatement, mais pas ncdu ; aussi, si vous voulez l'utiliser, il faut d'abord l'installer avec les commandes suivantes :

sudo apt-get update

sudo apt-get install ncdu

You can uninstall ncdu and its dependent packages. To remove the ncdu package and any other dependant package which are no longer needed: sudo apt-get remove –auto-remove ncdu If you are not that fussed about cleaning cruft with an application, you can still free up some space by running the following commands once in a while: sudo aptitude autoremove sudo apt-get clean Ubuntu doesn't get polluted much over time with one notable exception, namely old kernels. It even doesn't need defragmentation.

Get rid of cobwebs

Remove junk files. A common source is the automatic backup or autosave files often created by various editors. These files usually have a name ending with the tilde ~ character e.g.somefile.txt~ A simple script can help you locate files which are of no use to you:

# Define DRDT appropriately DRDT=xyz/tildefiles find $1 -iname “*~*” -exec mv {} $DRDT \; # Now you can deal with files in DRDT any way you want

Clear the browser caches

Use the tools provided by your browser.

Clear the thumbnails

For each shown picture, Ubuntu automatically creates a thumbnail, for viewing in the file manager. It stores those thumbnails in a hidden directory in your user account (names of hidden directories and hidden files start with a dot, like .cache or .bash_history. The dot makes them hidden).

Over time, the number of thumbnails can increase dramatically. Moreover, the thumbnail cache will eventually contain many superfluous thumbnails of pictures that don't exist anymore.

Clear the thumbnails every six months or so. The quickest way is to use the terminal commands as follows:

rm xyz/.cache/google-chrome/Default/Cache/*

rm xyz/.cache/chromium/Default/Cache/*

rm xyz/.compiz/session/*

Get rid of polluted settings in your web browser

Firefox and Chromium/Chrome add-ons and extensions: don't trust them blindly. And keep their number down anyway: don't turn Firefox and Chromium/Chrome into a Christmas tree. The more extensions you install, the bulkier your browser becomes. Polluted settings in Firefox, Chrome or Chromium are sometimes caused by rotten, shady or rogue add-ons and extensions. Furthermore, some add-ons may cause malfunctions in other add-ons, or even in the browser itself.

Broken symlinks

Symbolic links are often used to “store” multiple copies of the same file in different places but still reference to one file. What happens if I delete the original file but not the link? The link will remain but will point to a file that does not exist. This is called an orphaned or dangling link. Symbolic links are like shortcuts or references to the actual file or directory. One easy way to locate (and then remove) such broken links is :

find /path/to/search -type l -exec test ! -e {} \; -print

fsck

fsck “fsck” stands for “File System Consistency checK”. fsck is used to check and optionally repair one or more Linux filesystems. Filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).

You shouldn't need fsck for modern filesystems anyway since they have journaling functions and should be able to recover from crashes.

You will need root/superuser permission to run the “fsck” command.

# fsck /dev/sda6 #Output of fsck follows fsck from util-linux 2.20.1

e2fsck 1.42 (29-Nov-2011) /dev/sda6:clean,95/2240224files,3793506/4476416 blocks

During the filesystem check, if errors are detected, you can get “fsck” to auto repair the filesystem with the -y flag. For example:

fsck -y /dev/sda2

If you have installed and uninstalled a lot of applications, chances are your system is infected with a lot of dependencies files that you have absolutely no use for. Here are some useful commands to get rid of any partial package and remove any unused dependencies:

sudo apt-get clean

This will flush the local cache from the retrieved package files.

sudo apt-get autoclean

This will clear out only the absolutely not necessary packages that cannot be found in the repositories anymore, or a newer version of them is located.

sudo apt-get autoremove

This command will remove packages that were installed as dependencies for another package that has been removed, and so are no longer needed.

fslint

fslint is a utility to find and clean various forms of lint on a filesystem, especially duplicate files and broken symlinks.

To install fslint:

sudo apt-get install fslint

In Conclusion

Just like regular exercise helps you reduce your belly fat and keeps you fit, frequent housekeeping will ensure that your Linux system works effortlessly and flawlessly. This article has given an overview of the options which Linux offers you for housekeeping.

issue118/tutoriel1.1488808161.txt.gz · Dernière modification : 2017/03/06 14:49 de auntiee