Avast4Server on Ubuntu 8.10 broke Aptitude

For whatever reason, when I tried to install the package ‘avast4server-3.0.1-i586.deb’ the package manager failed during the install. Immediately thereafter if I tried reinstalling using Gdebi I get:

Could not open ‘avast4server-3.0.1-i586.deb’ The package might be corrupted or you are not allowed to open the file. Check the permissions of the file.

I know I have ownership and all permissions for the file. When I try running Synaptic it authenticates as normal but then tells me:

E: The package avast4server needs to be reinstalled, but I can’t find an archive for it.
E: Internal error opening cache (1). Please report.

and kicks me out. I don’t really care whether I keep Avast! or not, I just want to use my package manager again. :slight_smile:

Running ‘sudo dpkg -i avast4server-3.0.1-i586.deb’ produces:

(Reading database … 128894 files and directories currently installed.)
Preparing to replace avast4server 3.0.1 (using avast4server-3.0.1-i586.deb) …
.: 93: Can’t open /etc/sysconfig/avastd
dpkg: warning - old pre-removal script returned error exit status 2
dpkg - trying script from the new package instead …
.: 93: Can’t open /etc/sysconfig/avastd
dpkg: error processing avast4server-3.0.1-i586.deb (–install):
subprocess new pre-removal script returned error exit status 2
.: 93: Can’t open /etc/sysconfig/avastd
invoke-rc.d: initscript avastd, action “restart” failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
avast4server-3.0.1-i586.deb

I did a bit of digging on my own and came up with: ‘sudo dpkg --force-remove-reinstreq --remove avast4server’ which gave me basically the same thing:

dpkg - warning, overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database … 128893 files and directories currently installed.)
Removing avast4server …
.: 93: Can’t open /etc/sysconfig/avastd
dpkg: error processing avast4server (–remove):
subprocess pre-removal script returned error exit status 2
.: 93: Can’t open /etc/sysconfig/avastd
invoke-rc.d: initscript avastd, action “restart” failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
avast4server

Can someone please tell me how to fix this? Any ideas on what caused this in the first place? Any help would be very greatly appreciated.

Unfortunately, I have the exact same issue.

Have tried to send a ticket, but can’t even register, getting an irritating blank page.

Have now solved the issue by removing the Avast4Server rntry out of the dpkg status and re-saving the file, here is the command used

sudo gedit /var/lib/dpkg/status

The re-installed the deb package, this time without issues.

However, still would like an answer on how to properly solve this.

Rgds
JB

… and this is exactly why I personally hate all those “nice packaging systems”. in the case of any minor change/problem, they might turn into nightmare, which needs deeper user’s knowledge anyway (and thus, saves NOTHING, and makes things 10x worse than tarball-driven install).

those problems, in general, can be solved simply by manually-creating those files that are claimed as inaccessible, just to get the automatic script tainted and satisfied. echo “blahblah” >/etc/sysconfig/avastd should be enough :).

first, the package IS correct - /etc/default/avastd is there. And yes, during install, it IS extracted. But, this file is so called “config file”, and will stay here and/or won’t be refreshed, after package removal or with new reinstall.

just use dpkg --purge avast4server, and then, make a fresh install, and things would be OK.
well, /etc/init.d/avastd should be prepared also for this inconsistency, not claiming defaults to be present/readable, we’ll add this check too, thanks for report,

pc

the only thing that actually worked is:

rm /var/lib/dpkg/info/avast4server.prerm
dpkg -P --force-all avast4server

cheers