ModSecurity update/installation on Ubuntu server with Plesk fails: dpkg: error processing archive

Follow

Comments

10 comments

  • Avatar
    Deniss Korsakovs (Edited )

    Got fallowing error here

    mv /etc/apt/sources.list.d/ondrej-ubuntu-apache2-xenial.list /etc/apt/sources.list.d/ondrej-ubuntu-apache2-xenial.back
    mv: cannot stat ‘/etc/apt/sources.list.d/ondrej-ubuntu-apache2-xenial.list’: No such file or directory

    I have got only kcare.list, plesk.list, plesk-ext-docker.list, plesk-ext-nodejs.list, plesk-migrator.list

    Which of these I have to disable?

    Also apt-cache returned:
    500 http://ftp.debian.org/debian/ jessie/main amd64 Packages

    0
    Comment actions Permalink
  • Avatar
    Ralf Göldner (Edited )

    Have a similar issue on a Ubuntu 16.04 Host with latest Plesk 17.8.11 Update 67:

    root@IDofMACHINE:~# apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt autoclean
    Hit:1 http://autoinstall.plesk.com/ubuntu/PSA_17.8.11 xenial InRelease
    Hit:2 http://autoinstall.plesk.com/debian/SITEBUILDER_17.8.12 all InRelease
    Hit:3 http://autoinstall.plesk.com/ubuntu/PMM_0.1.10 xenial InRelease
    Hit:4 http://autoinstall.plesk.com/ubuntu/PHP52_17 xenial InRelease
    Hit:5 http://autoinstall.plesk.com/ubuntu/PHP53_17 xenial InRelease
    Hit:6 http://autoinstall.plesk.com/ubuntu/PHP54_17 xenial InRelease
    Hit:7 http://security.ubuntu.com/ubuntu xenial-security InRelease
    Hit:8 http://autoinstall.plesk.com/ubuntu/PHP55_17 xenial InRelease
    Hit:9 http://archive.ubuntu.com/ubuntu xenial InRelease
    Hit:10 http://autoinstall.plesk.com/ubuntu/PHP56_17 xenial InRelease
    Hit:11 http://autoinstall.plesk.com/ubuntu/PHP70_17 xenial InRelease
    Hit:12 http://autoinstall.plesk.com/PHP71_17 xenial InRelease
    Hit:13 http://autoinstall.plesk.com/PHP72_17 xenial InRelease
    Hit:14 http://autoinstall.plesk.com/PHP73_17 xenial InRelease
    Hit:15 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
    Hit:16 http://archive.canonical.com/ubuntu xenial InRelease
    Hit:17 https://updates.atomicorp.com/channels/tortix-common/debian xenial InRelease
    Reading package lists... Done
    N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these.
    The following packages have unmet dependencies:
    aum : Depends: libapache2-mod-security2 but it is not installed
    modsecurity-crs : Depends: libapache2-mod-security2 (>= 2.8.0) but it is not installed
    N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
    E: Unmet dependencies. Try using -f.

    root@IDofMACHINE:~# apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Correcting dependencies... Done
    The following additional packages will be installed:
    libapache2-mod-security2
    The following NEW packages will be installed:
    libapache2-mod-security2
    0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
    6 not fully installed or removed.
    Need to get 0 B/314 kB of archives.
    After this operation, 1230 kB of additional disk space will be used.
    Do you want to continue? [Y/n]
    N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
    Selecting previously unselected package libapache2-mod-security2.
    (Reading database ... 88402 files and directories currently installed.)
    Preparing to unpack .../libapache2-mod-security2_2.9.0-1_amd64.deb ...
    Unpacking libapache2-mod-security2 (2.9.0-1) ...
    dpkg: error processing archive /var/cache/apt/archives/libapache2-mod-security2_2.9.0-1_amd64.deb (--unpack):
    trying to overwrite '/usr/lib/apache2/modules/mod_security2.so', which is also in package libapache2-modsecurity 2.9.2-ubuntu16.04.18021217
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Errors were encountered while processing:
    /var/cache/apt/archives/libapache2-mod-security2_2.9.0-1_amd64.deb
    N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    There is and was no 3rd party repo installed.
    Any advice to fix this similar issue?

    See also: https://talk.plesk.com/threads/plesk-update-dependics.353386/

    0
    Comment actions Permalink
  • Avatar
    Daria Gavrilova

    Hello @Deniss Korsakovs,

    Thank you for your question.

    As I may see none of the provided lists may affect the update/installation of ModSecurity.

    There is a high probability that the issue from the following article was met: Atomic rule set installation/update fails on /usr/lib/apache2/modules/mod_security2.so

    0
    Comment actions Permalink
  • Avatar
    Daria Gavrilova

    Hello @Ralf Göldner,

    Thank you for your question.

    Such error can be seen due to the Plesk bug with ID PPPM-11003.

    Please check the workaround from the following article: Atomic rule set installation/update fails on /usr/lib/apache2/modules/mod_security2.so

    0
    Comment actions Permalink
  • Avatar
    François-Xavier Guénan

    Hello,

    I have the same problem, unfortunately, le link above isn't working anymore. May someone help me ?

    Preparing to unpack .../libapache2-modsecurity_2.9.2-ubuntu14.04.18021217_amd64.deb ...
    Unpacking libapache2-modsecurity (2.9.2-ubuntu14.04.18021217) over (2.7.7-2) ...
    dpkg: error processing archive /var/cache/apt/archives/libapache2-modsecurity_2.9.2-ubuntu14.04.18021217_amd64.deb (--unpack):
    trying to overwrite '/etc/apache2/mods-available/security2.conf', which is also in package libapache2-mod-security2 2.7.7-2
    dpkg-deb (subprocess): decompressing archive member: lzma write error: Broken pipe
    dpkg-deb: error: subprocess <decompress> returned error exit status 2
    dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/libapache2-modsecurity_2.9.2-ubuntu14.04.18021217_amd64.deb' to decompressor pipe: failed to write (Broken pipe)
    Errors were encountered while processing:
    /var/cache/apt/archives/libapache2-modsecurity_2.9.2-ubuntu14.04.18021217_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Error: An error occurred on attempt to install packages.
    Attention! Your software might be inoperable.
    Please contact product technical support.
    0
    Comment actions Permalink
  • Avatar
    Francisco Garcia

    Hi François-Xavier Guénan,

    What repos are enabled on the server?

    From where the package libapache2-mod-security2 comes from?

    Did you try the resolution from this article?

    0
    Comment actions Permalink
  • Avatar
    François-Xavier Guénan

    Hi  Francisco Garcia,

    Thanks for answering.

    Here are repos enabled :

    root@:/# ls -l /etc/apt/sources.list.d/
    total 104
    -rw-r--r-- 1 root root 859 sept. 11  2016 50sw_autoinstaller.list.distUpgrade
    -rw-r--r-- 1 root root 782 sept. 12  2016 50sw_autoinstaller.list.save
    -rw-r--r-- 1 root root 144 févr.  5 14:01 mc3man-trusty-media-trusty.list
    -rw-r--r-- 1 root root 500 mai   14  2019 mysql.list
    -rw-r--r-- 1 root root  65 nov.  20 22:02 plesk-ext-nodejs.list
    -rw-r--r-- 1 root root  75 nov.  20 22:01 plesk-ext-ruby.list
    -rw-r--r-- 1 root root 637 avril  1 17:18 plesk.list
    -rw-r--r-- 1 root root 570 oct.   6  2017 plesk.list.save
    -rw-r--r-- 1 root root  75 oct.  31 07:37 plesk-migrator.list
    -rw-r--r-- 1 root root 200 sept. 11  2016 plesk-php5.2.list.distUpgrade
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php5.2.list.save
    -rw-r--r-- 1 root root 200 sept. 11  2016 plesk-php5.3.list.distUpgrade
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php5.3.list.save
    -rw-r--r-- 1 root root 200 sept. 11  2016 plesk-php5.4.list.distUpgrade
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php5.4.list.save
    -rw-r--r-- 1 root root 200 sept. 11  2016 plesk-php5.5.list.distUpgrade
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php5.5.list.save
    -rw-r--r-- 1 root root 200 sept. 11  2016 plesk-php5.6.list.distUpgrade
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php5.6.list.save
    -rw-r--r-- 1 root root 200 sept. 12  2016 plesk-php7.0.list.save
    -rw-r--r-- 1 root root 142 oct.   6  2017 ubuntu-mate-dev-ppa-trusty.list
    -rw-r--r-- 1 root root 142 oct.   6  2017 ubuntu-mate-dev-ppa-trusty.list.save
    -rw-r--r-- 1 root root 158 oct.   6  2017 ubuntu-mate-dev-trusty-mate-trusty.list
    -rw-r--r-- 1 root root 158 oct.   6  2017 ubuntu-mate-dev-trusty-mate-trusty.list.save
    -rw-r--r-- 1 root root 126 oct.   6  2017 x2go-stable-trusty.list
    -rw-r--r-- 1 root root 126 oct.   6  2017 x2go-stable-trusty.list.save

    And here is the output of apt-cache policy :

    root@:/# apt-cache policy libapache2-mod-security2
    libapache2-mod-security2:
      Installé : 2.7.7-2
      Candidat : 2.7.7-2
     Table de version :
     *** 2.7.7-2 0
            500 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
            100 /var/lib/dpkg/status

    Thanks for your feedback !

     

    FX

    0
    Comment actions Permalink
  • Avatar
    Francisco Garcia

    Hi François-Xavier Guénan,

    Sorry for not seeing this before, but you have an EOL operating system. Please migrate to newer OS version, it will be way easier than doing a distro-upgrade.

    1
    Comment actions Permalink
  • Avatar
    François-Xavier Guénan

    Thank you... I'll backup the whole server and give a try to a dist-upgrade using provided scripts by Plesk. ( https://support.plesk.com/hc/en-us/articles/213410369-How-to-perform-dist-upgrade-procedure-on-Linux-server-with-Plesk-#distupgrade )

     

    Sincerely,

     

    FX

    0
    Comment actions Permalink
  • Avatar
    François-Xavier Guénan

    Hello !

    I've fixed the error by force installing libapache2-mod-security2_2.9.0-2_amd64.deb

    Related thread : https://talk.plesk.com/threads/plesk-update-dependics.353386/

    Then I've been able to dist upgrade to ubuntu 16 and upgrade to Obsedian using script provided by Plesk : https://support.plesk.com/hc/en-us/articles/213410369-How-to-perform-dist-upgrade-procedure-on-Linux-server-with-Plesk-

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request