在ubuntu 16.04中snapd包管理器问题,如何解决?

After this operation, 33.0 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 329734 files and directories currently installed.) Removing snapd (2.21~14.04) ... Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded. dpkg: error processing package snapd (--remove): subprocess installed pre-removal script returned error exit status 5 Failed to get unit file state for snapd.refresh.timer: No such file or directory snapd.refresh.timer is a disabled or a static unit, not starting it. Failed to get unit file state for snapd.autoimport.service: No such file or directory snapd.autoimport.service is a disabled or a static unit, not starting it. Errors were encountered while processing: snapd E: Sub-process /usr/bin/dpkg returned an error code (1) 

在shebang之后将exit 0添加到/var/lib/dpkg/info/snapd.prerm

接下来删除一个包dpkg --purge --force-all snapd

检查你的pkg来源是否可靠rgrep 'xenial' /etc/apt ,并删除我所对应的所有来源的inperper版本的snapd。

运行apt-get update ,并将系统升级为一致状态。