E: Sub-process /usr/bin/dpkg returned an error code (1)

Bug #1945295 reported by coffeepixel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Undecided
Unassigned

Bug Description

Trying to remove LAMP (Ubuntu 20.04):

Configuring apache2 (2.4.41-4ubuntu3.5) ...
ERROR: Module mpm_event does not exist!
dpkg: error processing apache2 package (--configure):
  the installed subprocess, from the apache2 package, the post-installation script returned
  exit status error 1
Errors were encountered while processing:
  apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: apache2 2.4.41-4ubuntu3.5
ProcVersionSignature: Ubuntu 5.11.0-36.40~20.04.1-generic 5.11.22
Uname: Linux 5.11.0-36-generic x86_64
Apache2ConfdDirListing: False
Apache2Modules:
 Error: command ['/usr/sbin/apachectl', '-D DUMP_MODULES'] failed with exit code 127: /usr/sbin/apachectl: 208: /usr/sbin/apache2: not found
 Action '-D DUMP_MODULES' failed.
 The Apache error log may have more information.
ApportVersion: 2.20.11-0ubuntu27.20
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue Sep 28 04:45:29 2021
ErrorMessage: o subprocesso instalado, do pacote apache2, o script post-installation retornou erro do status de saída 1
InstallationDate: Installed on 2021-09-26 (1 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.6
SourcePackage: apache2
Title: package apache2 2.4.41-4ubuntu3.5 failed to install/upgrade: o subprocesso instalado, do pacote apache2, o script post-installation retornou erro do status de saída 1
UpgradeStatus: No upgrade log present (probably fresh install)
error.log: Error: [Errno 2] Arquivo ou diretório inexistente: '/var/log/apache2/error.log'
modified.conffile..etc.apache2.apache2.conf: [deleted]
modified.conffile..etc.apache2.conf-available.charset.conf: [deleted]
modified.conffile..etc.apache2.conf-available.localized-error-pages.conf: [deleted]
modified.conffile..etc.apache2.conf-available.other-vhosts-access-log.conf: [deleted]
modified.conffile..etc.apache2.conf-available.security.conf: [deleted]
modified.conffile..etc.apache2.conf-available.serve-cgi-bin.conf: [deleted]
modified.conffile..etc.apache2.envvars: [deleted]
modified.conffile..etc.apache2.magic: [deleted]
modified.conffile..etc.apache2.mods-available.access_compat.load: [deleted]
modified.conffile..etc.apache2.mods-available.actions.conf: [deleted]
modified.conffile..etc.apache2.mods-available.actions.load: [deleted]
modified.conffile..etc.apache2.mods-available.alias.conf: [deleted]
modified.conffile..etc.apache2.mods-available.alias.load: [deleted]
modified.conffile..etc.apache2.mods-available.allowmethods.load: [deleted]
modified.conffile..etc.apache2.mods-available.asis.load: [deleted]
modified.conffile..etc.apache2.mods-available.auth_basic.load: [deleted]
modified.conffile..etc.apache2.mods-available.auth_digest.load: [deleted]
modified.conffile..etc.apache2.mods-available.auth_form.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_anon.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_core.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_dbd.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_dbm.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_file.load: [deleted]
modified.conffile..etc.apache2.mods-available.authn_socache.load: [deleted]
modified.conffile..etc.apache2.mods-available.authnz_fcgi.load: [deleted]
modified.conffile..etc.apache2.mods-available.authnz_ldap.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_core.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_dbd.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_dbm.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_groupfile.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_host.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_owner.load: [deleted]
modified.conffile..etc.apache2.mods-available.authz_user.load: [deleted]
modified.conffile..etc.apache2.mods-available.autoindex.conf: [deleted]
modified.conffile..etc.apache2.mods-available.autoindex.load: [deleted]
modified.conffile..etc.apache2.mods-available.brotli.load: [deleted]
modified.conffile..etc.apache2.mods-available.buffer.load: [deleted]
modified.conffile..etc.apache2.mods-available.cache.load: [deleted]
modified.conffile..etc.apache2.mods-available.cache_disk.conf: [deleted]
modified.conffile..etc.apache2.mods-available.cache_disk.load: [deleted]
modified.conffile..etc.apache2.mods-available.cache_socache.load: [deleted]
modified.conffile..etc.apache2.mods-available.cern_meta.load: [deleted]
modified.conffile..etc.apache2.mods-available.cgi.load: [deleted]
modified.conffile..etc.apache2.mods-available.cgid.conf: [deleted]
modified.conffile..etc.apache2.mods-available.cgid.load: [deleted]
modified.conffile..etc.apache2.mods-available.charset_lite.load: [deleted]
modified.conffile..etc.apache2.mods-available.data.load: [deleted]
modified.conffile..etc.apache2.mods-available.dav.load: [deleted]
modified.conffile..etc.apache2.mods-available.dav_fs.conf: [deleted]
modified.conffile..etc.apache2.mods-available.dav_fs.load: [deleted]
modified.conffile..etc.apache2.mods-available.dav_lock.load: [deleted]
modified.conffile..etc.apache2.mods-available.dbd.load: [deleted]
modified.conffile..etc.apache2.mods-available.deflate.conf: [deleted]
modified.conffile..etc.apache2.mods-available.deflate.load: [deleted]
modified.conffile..etc.apache2.mods-available.dialup.load: [deleted]
modified.conffile..etc.apache2.mods-available.dir.conf: [deleted]
modified.conffile..etc.apache2.mods-available.dir.load: [deleted]
modified.conffile..etc.apache2.mods-available.dump_io.load: [deleted]
modified.conffile..etc.apache2.mods-available.echo.load: [deleted]
modified.conffile..etc.apache2.mods-available.env.load: [deleted]
modified.conffile..etc.apache2.mods-available.expires.load: [deleted]
modified.conffile..etc.apache2.mods-available.ext_filter.load: [deleted]
modified.conffile..etc.apache2.mods-available.file_cache.load: [deleted]
modified.conffile..etc.apache2.mods-available.filter.load: [deleted]
modified.conffile..etc.apache2.mods-available.headers.load: [deleted]
modified.conffile..etc.apache2.mods-available.heartbeat.load: [deleted]
modified.conffile..etc.apache2.mods-available.heartmonitor.load: [deleted]
modified.conffile..etc.apache2.mods-available.http2.conf: [deleted]
modified.conffile..etc.apache2.mods-available.http2.load: [deleted]
modified.conffile..etc.apache2.mods-available.ident.load: [deleted]
modified.conffile..etc.apache2.mods-available.imagemap.load: [deleted]
modified.conffile..etc.apache2.mods-available.include.load: [deleted]
modified.conffile..etc.apache2.mods-available.info.conf: [deleted]
modified.conffile..etc.apache2.mods-available.info.load: [deleted]
modified.conffile..etc.apache2.mods-available.lbmethod_bybusyness.load: [deleted]
modified.conffile..etc.apache2.mods-available.lbmethod_byrequests.load: [deleted]
modified.conffile..etc.apache2.mods-available.lbmethod_bytraffic.load: [deleted]
modified.conffile..etc.apache2.mods-available.lbmethod_heartbeat.load: [deleted]
modified.conffile..etc.apache2.mods-available.ldap.conf: [deleted]
modified.conffile..etc.apache2.mods-available.ldap.load: [deleted]
modified.conffile..etc.apache2.mods-available.log_debug.load: [deleted]
modified.conffile..etc.apache2.mods-available.log_forensic.load: [deleted]
modified.conffile..etc.apache2.mods-available.lua.load: [deleted]
modified.conffile..etc.apache2.mods-available.macro.load: [deleted]
modified.conffile..etc.apache2.mods-available.md.load: [deleted]
modified.conffile..etc.apache2.mods-available.mime.conf: [deleted]
modified.conffile..etc.apache2.mods-available.mime.load: [deleted]
modified.conffile..etc.apache2.mods-available.mime_magic.conf: [deleted]
modified.conffile..etc.apache2.mods-available.mime_magic.load: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_event.conf: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_event.load: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_prefork.conf: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_prefork.load: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_worker.conf: [deleted]
modified.conffile..etc.apache2.mods-available.mpm_worker.load: [deleted]
modified.conffile..etc.apache2.mods-available.negotiation.conf: [deleted]
modified.conffile..etc.apache2.mods-available.negotiation.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy.conf: [deleted]
modified.conffile..etc.apache2.mods-available.proxy.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_ajp.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_balancer.conf: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_balancer.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_connect.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_express.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_fcgi.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_fdpass.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_ftp.conf: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_ftp.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_hcheck.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_html.conf: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_html.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_http.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_http2.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_scgi.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_uwsgi.load: [deleted]
modified.conffile..etc.apache2.mods-available.proxy_wstunnel.load: [deleted]
modified.conffile..etc.apache2.mods-available.ratelimit.load: [deleted]
modified.conffile..etc.apache2.mods-available.reflector.load: [deleted]
modified.conffile..etc.apache2.mods-available.remoteip.load: [deleted]
modified.conffile..etc.apache2.mods-available.reqtimeout.conf: [deleted]
modified.conffile..etc.apache2.mods-available.reqtimeout.load: [deleted]
modified.conffile..etc.apache2.mods-available.request.load: [deleted]
modified.conffile..etc.apache2.mods-available.rewrite.load: [deleted]
modified.conffile..etc.apache2.mods-available.sed.load: [deleted]
modified.conffile..etc.apache2.mods-available.session.load: [deleted]
modified.conffile..etc.apache2.mods-available.session_cookie.load: [deleted]
modified.conffile..etc.apache2.mods-available.session_crypto.load: [deleted]
modified.conffile..etc.apache2.mods-available.session_dbd.load: [deleted]
modified.conffile..etc.apache2.mods-available.setenvif.conf: [deleted]
modified.conffile..etc.apache2.mods-available.setenvif.load: [deleted]
modified.conffile..etc.apache2.mods-available.slotmem_plain.load: [deleted]
modified.conffile..etc.apache2.mods-available.slotmem_shm.load: [deleted]
modified.conffile..etc.apache2.mods-available.socache_dbm.load: [deleted]
modified.conffile..etc.apache2.mods-available.socache_memcache.load: [deleted]
modified.conffile..etc.apache2.mods-available.socache_redis.load: [deleted]
modified.conffile..etc.apache2.mods-available.socache_shmcb.load: [deleted]
modified.conffile..etc.apache2.mods-available.speling.load: [deleted]
modified.conffile..etc.apache2.mods-available.ssl.conf: [deleted]
modified.conffile..etc.apache2.mods-available.ssl.load: [deleted]
modified.conffile..etc.apache2.mods-available.status.conf: [deleted]
modified.conffile..etc.apache2.mods-available.status.load: [deleted]
modified.conffile..etc.apache2.mods-available.substitute.load: [deleted]
modified.conffile..etc.apache2.mods-available.suexec.load: [deleted]
modified.conffile..etc.apache2.mods-available.unique_id.load: [deleted]
modified.conffile..etc.apache2.mods-available.userdir.conf: [deleted]
modified.conffile..etc.apache2.mods-available.userdir.load: [deleted]
modified.conffile..etc.apache2.mods-available.usertrack.load: [deleted]
modified.conffile..etc.apache2.mods-available.vhost_alias.load: [deleted]
modified.conffile..etc.apache2.mods-available.xml2enc.load: [deleted]
modified.conffile..etc.apache2.ports.conf: [deleted]
modified.conffile..etc.apache2.sites-available.000-default.conf: [deleted]
modified.conffile..etc.apache2.sites-available.default-ssl.conf: [deleted]

Revision history for this message
coffeepixel (coffeepixel) wrote :
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thank you for taking the time to file a bug report.

I looked at the log files you attached to the bug, and the following error message caught my attention:

Configurando apache2 (2.4.41-4ubuntu3.5) ...
Enabling module mpm_event.
cp: não foi possível obter estado de '/usr/share/apache2/default-site/index.html': Arquivo ou diretório inexistente
dpkg: erro ao processar o pacote apache2 (--configure):
 o subprocesso instalado, do pacote apache2, o script post-installation retornou erro do status de saída 1

This means that apache2 was expecting to find /usr/share/apache2/default-site/index.html in order to properly copy it over somehwere, but could not find it. Now, it is really strange that this file is missing: it is part of the apache2-data package, which (according to your logs) is properly installed in your system. The only thing I can think of is that you may have inadvertently removed this file by hand, causing the installation of apache2 to fail. If you would like to reinstall the package, you can do the following:

# apt install --reinstall apache2-data

Otherwise, if you don't agree with my analysis, please provide more instructions/information so that we can try to reproduce the issue here.

Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'.

However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, explain why you believe this is a bug in Ubuntu
rather than a problem specific to your system, and then change the bug
status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in apache2 (Ubuntu):
status: New → Incomplete
Revision history for this message
coffeepixel (coffeepixel) wrote :

The problem escalated and I was forced to reinstall the system. I don't really know what happened, but at one point it was not possible to access the system settings.

The only thing I can say is that I followed a tutorial on GitHub on how to completely remove LAMP [https://gist.github.com/UbuntuEvangelist/9d115b4ca95c330ef6d2dd42f6c133c9] and that maybe the Apache problem arose from that. But the problem escalates to the point where I can no longer access the system settings remains a mystery to me...

Revision history for this message
Paride Legovini (paride) wrote :

I had a look to that gist; the steps look mostly sane (still not to be applied blindly I'd say), however they are not safe for corner cases, as Sergio's comment points out.

Without steps to reproduce or at least the full system logs it's difficult to guess what may have happened. At the moment there's little we can do to investigate the problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for apache2 (Ubuntu) because there has been no activity for 60 days.]

Changed in apache2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers