scripts: handle init system switching in nodocs tests

reinstall packages that may be potentially removed and reinstalled
before taking the reference snapshot

Signed-off-by: Andreas Beckmann <anbe@debian.org>
p: create /etc/resolv.conf with only nameserver entries

Signed-off-by: Andreas Beckmann <anbe@debian.org>