Don't try this at home, kids!

Probably the most deceptively efficient bug finding tool I've come across in a long time:

sudo apt-get --reinstall --ignore-missing install $(dpkg --get-selections | cut -f 1)

That apparently innocent APT recipe has been found to reveal tons of packaging mistakes, such as dependency cycles and broken maintainer scripts, even in packages as essential as bash and libc6. On systems where insserv is installed, even uglier dependency cycles, this time between init scripts, appear in important packages such as ifupdown and netbase.

Warning: usage of this deceptively simple command line recipe can become addictive and result in mass filing of bugs, especially against packages in development releases such as Debian/Squeeze and Ubuntu/Karmic. The author of this blog article makes no guarantee about how bad of a karma someone might accumulate as a result. You have been warned.

1 kommentti:

Unknown kirjoitti...

Am I missing something or will that small recipe reinstall both all installed and explicitly deinstalled packages!?

I'd rather use `dpkg --get-selections|awk '$2 != "install" { print $1 }`` for the package list.

You might also want to use '$2 == install' to spare uninstalling packages that are on hold.