snapd package manager problem in ubuntu 16.04 , how to resolve?

Solution 1:

Add exit 0 after shebang to /var/lib/dpkg/info/snapd.prerm.

Next remove a package dpkg --purge --force-all snapd.

Check you pkg sources for trusty rgrep 'xenial' /etc/apt, and remove all sources that my be correspond to inproper version of snapd.

Run apt-get update, and upgrade a system to be in consistent state.