I've tried this approach mentioned in many places, but it fails with the following error message:
sudo echo PURGE | debconf-communicate mirrorsync debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied 0
I suspect that the problem is that sudo is no longer effective after the pipe character so the subsequent command is not as root.