ossec / ossec-hids

OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.
http://www.ossec.net
Other
4.42k stars 1.03k forks source link

Ubuntu 16.04 LTS upgrade issue #1567

Closed hibari0614 closed 5 years ago

hibari0614 commented 5 years ago

Hi

I would like to upgrade the OSSEC server to 3.1.0--5711xenial on Ubuntu 16.04 LTS with apt-get command, but there is a error occurred and the upgrading process is stopped.

The apt-get command return below error message. Seem the prerm script in .deb package cannot recognizes 'upgrade' parameter.

Did someone could kindly look over this issue ? Its seem like a bug.

$> sudo apt-get upgrade ossec-hids-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  ossec-hids-server
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 658 kB of archives.
After this operation, 4,096 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://updates.atomicorp.com/channels/atomic/ubuntu xenial/main amd64 ossec-hids-server amd64 3.1.0-5711xenial [658 kB]
Fetched 658 kB in 0s (1,875 kB/s)     
Preconfiguring packages ...
(Reading database ... 97299 files and directories currently installed.)
Preparing to unpack .../ossec-hids-server_3.1.0-5711xenial_amd64.deb ...
prerm called with unknown argument `upgrade'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
prerm called with unknown argument `failed-upgrade'
dpkg: error processing archive /var/cache/apt/archives/ossec-hids-server_3.1.0-5711xenial_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/ossec-hids-server_3.1.0-5711xenial_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
joshstoik1 commented 5 years ago

FYI, looks like Debian Stretch packages are having the same issue.

prerm called with unknown argument `upgrade'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
prerm called with unknown argument `failed-upgrade'
dpkg: error processing archive /var/cache/apt/archives/ossec-hids-agent_3.1.0.5711stretch_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/ossec-hids-agent_3.1.0.5711stretch_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
c0m4r commented 5 years ago

I can confirm that too on my Debian Stretch:

Upgrading from version: 3.1.0.5696stretch

Preparing to unpack .../ossec-hids-server_3.1.0.5711stretch_amd64.deb ...
prerm called with unknown argument `upgrade'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
prerm called with unknown argument `failed-upgrade'
dpkg: error processing archive /var/cache/apt/archives/ossec-hids-server_3.1.0.5711stretch_amd64.deb (--install):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/ossec-hids-server_3.1.0.5711stretch_amd64.deb

sha256sum

d47a8a1ea688dad3eac016ba491d87522a2bbcda4601092e82d3a2c20ecd63dd  /var/cache/apt/archives/ossec-hids-server_3.1.0.5711stretch_amd64.deb

/etc/apt/sources.list.d/atomic.list

deb https://updates.atomicorp.com/channels/atomic/debian stretch main
esamattis commented 5 years ago

We're seeing this too with Ubuntu 18.04 (bionic). Package ossec-hids-server_3.1.0-5711bionic_amd64.deb.

hristian-carabulea commented 5 years ago

Hi. I am getting also an error in Ubuntu 18.04, Linux 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic

error message

Preparing to unpack .../ossec-hids-server_3.1.0-5711bionic_amd64.deb ... prerm called with unknown argument upgrade' dpkg: warning: old ossec-hids-server package pre-removal script subprocess returned error exit status 1 dpkg: trying script from the new package instead ... prerm called with unknown argumentfailed-upgrade' dpkg: error processing archive /var/cache/apt/archives/ossec-hids-server_3.1.0-5711bionic_amd64.deb (--unpack): new ossec-hids-server package pre-removal script subprocess returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/ossec-hids-server_3.1.0-5711bionic_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

end error message
a10kiloham commented 5 years ago

+1 Ubuntu 18.04

jsandroid1 commented 5 years ago

We also have the problem on Ubuntu 14 - see https://github.com/ossec/ossec-hids/issues/1540

dpkg: error processing archive /var/cache/apt/archives/ossec-hids-agent_3.1.0-5711trusty_amd64.deb (--unpack): subprocess new pre-removal script returned error exit status 1 Errors were encountered while processing: /var/cache/apt/archives/ossec-hids-agent_3.1.0-5711trusty_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

atomicturtle commented 5 years ago

Updated & sync'd to mirrors in build 5732

a10kiloham commented 5 years ago

This fails on current Ubuntu 18 LTS in agent only config --

Setting up ossec-hids-agent (3.1.0-5732bionic) ...
chown: invalid user: ‘ossec:ossec’