package clamav-daemon 0.99+dfsg-1ubuntu1.1 failed to install/upgrade: subprocess new pre-removal script returned error exit status 5

Bug #1619064 reported by David Fell
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
clamav (Ubuntu)
Fix Released
High
Unassigned
Xenial
Incomplete
Medium
Unassigned

Bug Description

Was updating Mate desktop to 1.14.1

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: clamav-daemon 0.99+dfsg-1ubuntu1.1
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Wed Aug 31 22:54:06 2016
ErrorMessage: subprocess new pre-removal script returned error exit status 5
InstallationDate: Installed on 2012-09-24 (1437 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64+mac (20120425.1)
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-34-generic root=UUID=e1286cbc-b96f-499a-bc75-2b490f1fddc2 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.12~ubuntu16.04.1
SourcePackage: clamav
Title: package clamav-daemon 0.99+dfsg-1ubuntu1.1 failed to install/upgrade: subprocess new pre-removal script returned error exit status 5
UpgradeStatus: Upgraded to xenial on 2016-07-07 (54 days ago)

Revision history for this message
David Fell (david-fell4) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clamav (Ubuntu):
status: New → Confirmed
Revision history for this message
Alan (alan-pd-watson) wrote :
Download full text (7.3 KiB)

I run a daily script to get updates and upgrades - the following terminal output describes the actions and errors arising
//=========================================================================
apt-get dist-upgrade running

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  clamav-daemon
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
23 not fully installed or removed.
Need to get 0 B/195 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 356607 files and directories currently installed.)
Preparing to unpack .../clamav-daemon_0.99+dfsg-1ubuntu1.2_amd64.deb ...
Failed to stop clamav-daemon.socket: Unit clamav-daemon.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 clamav-daemon.socket: Unit clamav-daemon.socket not loaded.
dpkg: error processing archive /var/cache/apt/archives/clamav-daemon_0.99+dfsg-1ubuntu1.2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 5
insserv: script virtualbox: service vboxdrv already provided!
insserv: script virtualbox: service virtualbox already provided!
Failed to start clamav-daemon.service: Unit clamav-daemon.socket is not loaded properly: Invalid argument.
See system logs and 'systemctl status clamav-daemon.service' for details.
invoke-rc.d: initscript clamav-daemon, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/clamav-daemon_0.99+dfsg-1ubuntu1.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

apt-get dist-upgrade complete

apt-get upgrade running

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  clamav-daemon
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
23 not fully installed or removed.
Need to get 0 B/195 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
(Reading database ... 356607 files and directories currently installed.)
Preparing to unpack .../clamav-daemon_0.99+dfsg-1ubuntu1.2_amd64.deb ...
Failed to stop clamav-daemon.socket: Unit clamav-daemon.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 clamav-daemon.socket: Unit clamav-daemon.socket not loaded.
dpkg: error processing archive /var/cache/apt/archives/clamav-daemon_0.99+dfsg-1ubuntu1.2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 5
insserv: script virtualbox: service vboxdrv already provided!
insserv: script virtualbox: service virtualbox already provided!
Failed to start clamav-daemon.service: Unit ...

Read more...

Changed in clamav (Ubuntu):
importance: Undecided → High
Revision history for this message
John Douglas (john-douglas) wrote :

The seem to be multiple version live, see
# apt list --upgradeable
Listing... Done
clamav-daemon/xenial-updates 0.99+dfsg-1ubuntu1.2 amd64 [upgradable from: 0.99+dfsg-1ubuntu1.1]
N: There are 2 additional versions. Please use the '-a' switch to see them.
# apt list --upgradable -a
Listing... Done
clamav-daemon/xenial-updates 0.99+dfsg-1ubuntu1.2 amd64 [upgradable from: 0.99+dfsg-1ubuntu1.1]
clamav-daemon/now 0.99+dfsg-1ubuntu1.1 amd64 [installed,upgradable to: 0.99+dfsg-1ubuntu1.2]
clamav-daemon/xenial 0.99+dfsg-1ubuntu1 amd64

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Working on some of the recent changes I know that a freshly installed clamav does not start the daemon right away. It can't since freshclam hasn't provided any definitions yet.
The clamav-daemon has a condition in its unit file that tests on the availability of such files.

Unfortunately there is no mechanism yet to let the service reevaluate that once freshclam is done, that was part of a discussion in the other bug I remember.

The implications for this bug might be that a service not started due to this might - on a later upgrade run into this I have seen in your log:
  Failed to stop clamav-daemon.socket: Unit clamav-daemon.socket not loaded.

IMHO that stopping in the prerm should be non fatal in case it already (or still) is stopped.

Could you as a try manually start your clamav-daemon (now after a while of freshclam running it should be able to). And then update again. I would hope that then the prerm can shut it down as expected and your update can proceed. No fix yet but a workaround worth trying.

Revision history for this message
公输目 (yue937) wrote :

bug after update

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

There was no update after all the time - did the manual start fix it up for you so that the update can restart the service?

Changed in clamav (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Also in general the whole thing around the socket got removed.

So the old issue:
Failed to stop clamav-daemon.socket: Unit clamav-daemon.socket not loaded.

Should be fixed indirectly by:
0.99.2+dfsg-3
  * Drop support for clamav-daemon.socket. Should avoid restart loops if clamd
    crashes on start (via OOM for instance)

The latter applies to Zesty and later.
Still looking for feedback to my former question to consider SRU'ing something or not.

Changed in clamav (Ubuntu Xenial):
status: New → Incomplete
Changed in clamav (Ubuntu):
status: Incomplete → Fix Released
Changed in clamav (Ubuntu Xenial):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.