E: Sub-process /usr/bin/dpkg returned an error code
Something wired happend when I tried to remove some package in Ubuntu. Here is the error:
dpkg: error processing package mariadb-common (--configure): dependency problems - leaving unconfigured Setting up libreadline5:amd64 (5.2+dfsg-3build1) ... No apport report written because the error message indicates its a followup error from a previous failure. dpkg: dependency problems prevent configuration of mariadb-client-core-10.0: mariadb-client-core-10.0 depends on mariadb-common (>= 10.0.29-0ubuntu0.16.04.1); however: Package mariadb-common is not configured yet. dpkg: error processing package mariadb-client-core-10.0 (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of mariadb-client-10.0: mariadb-client-10.0 depends on mariadb-client-core-10.0 (>= 10.0.29-0ubuntu0.16.04.1); however: Package mariadb-client-core-10.0 is not configured yet. dpkg: error processing package mariadb-client-10.0 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of mariadb-client: mariadb-client depends on mariadb-client-10.0 (>= 10.0.29-0ubuntu0.16.04.1); however: Package mariadb-client-10.0 is not configured yet. dpkg: error processing package mariadb-client (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already Processing triggers for libc-bin (2.23-0ubuntu7) ... Errors were encountered while processing: mysql-common mariadb-common mariadb-client-core-10.0 mariadb-client-10.0 mariadb-client E: Sub-process /usr/bin/dpkg returned an error code (1)
Solution:
rm /var/lib/dpkg/info/*