Snippets tagged "debian linux" Snippets tagged "debian linux"

Vérifier l'empreinte md5 d'une image ISO

Avec md5sum :

$ md5sum feisty-desktop-i386.iso

Comparer l'empreinte de l'image ISO avec celle du CD gravé :

Trouver le périphérique à vérifier :

$ cat /etc/fstab | grep cdrom

Vérification :

$ md5sum /dev/hdb
by Nicolas Perriault on 2007-02-17, tagged cdrom  cli  debian  iso  linux  md5  ubuntu 

Turn on Bash Smart Completion

Just edit /etc/bash.bashrc

Uncomment the following lines, by removing the # in the beginning of the lines:

#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

Now, resource the modified file :

$ source /etc/bash.bashrc

Then try to tape apt-cache [TAB][TAB]

You will have this result in replacement of the habitual list of files and directories of your current path :

$ apt-cache
add        dotty      dumpavail  pkgnames   rdepends   show       showsrc    unmet
depends    dump       gencaches  policy     search     showpkg    stats      xvcg

It works with a lot of functions like cd (it will provide only directories), apt-get,...

It also enable code completion when using the sudo command.

Isn't it useful ?

Nota : The tip I give here is to activate Smart Completion for all users. If you want to activate it for only one user (or if you want to activate it but doesn't have write rights to /etc/bash.bashrc) you can modify your ~/.bashrc file and uncomment the same lines as described upper and resource it with

$ source ~/.bashrc
by gameplayer on 2007-01-11, tagged bash  debian  linux  sysadmin  ubuntu 
(2 comments)

Downgrader un package sous Ubuntu

On peut forcer la version d'un paquet à installer :

$ sudo aptitude install nomdupaquet=1.2.3-version2
by Nicolas Perriault on 2006-12-21, tagged apt  debian  linux  sysadmin  ubuntu 

Exporter et réimporter la liste des paquets installés

Genre pour reproduire la config d'un ancien serveur vers un nouveau serveur.

Export :

$ sudo dpkg --get-selections > selections.txt

Réimportation :

$ sudo dpkg --set-selections < selections.txt

Réinstallation des paquets :

$ sudo apt-get dselect-upgrade
by Nicolas Perriault on 2006-11-01, tagged backup  debian  dpkg  linux  restore  server  sysadmin  ubuntu