debian, ubuntu reinstalling whole system

sudo aptitude reinstall ~i
or (for zsh)
sudo aptitude reinstall \~i