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

5,494

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.

Share:
5,494

Related videos on Youtube

seshu p
Author by

seshu p

Updated on September 18, 2022

Comments

  • seshu p
    seshu p almost 2 years
    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)
    
    • doug
      doug over 7 years
      What are you doing with a trusty (14.04) backport package in xenial (16.04)?
    • vskubriev
      vskubriev over 7 years
      Yeah. It is true, that this error appears when you install trusty snapd package in ubuntu xenial by a mistake.
  • Jonny
    Jonny about 7 years
    works like a charm!
  • iWizard
    iWizard about 7 years
    saved my day :)
  • Donavan White
    Donavan White over 6 years
    Much useful information when debugging bad package installs.