1

When I run sudo apt-get update && sudo apt-get dist-upgrade -y I get the following error

(Reading database ... 135000 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.15_all.deb ...
Failed to stop apport-forward.socket: Unit apport-forward.socket not loaded.
dpkg: warning: subprocess old pre-removal script returned error exit status 5
dpkg: trying script from the new package instead ...
Failed to stop apport-forward.socket: Unit apport-forward.socket not loaded.
dpkg: error processing archive /var/cache/apt/archives/apport_2.20.1-0ubuntu2.15_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 5
/usr/bin/deb-systemd-helper: error: unable to read apport-forward.socket
Failed to get unit file state for apport-forward.socket: No such file or directory
apport-forward.socket is a disabled or a static unit, not starting it.
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.15_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What can I do to fix this?

1 Answers1

1

The best thing you can do is to remove the package (uninstall it) that is causing the problem, here some examples:

After removing the package that is causing the problem, you can update your system and finally re-install the package if required.

Hope this helps.

galoget
  • 2,963
  • I actually just commented out the problem lines in /var/lib/dpkg/info/apport.prerm , uninstalled apport, reinstalled apport, then upgraded. BOOM. problem fixed! – Native Coder Jan 04 '18 at 02:38