I am working to fix this, but as a side note, for real users this also happens but is not super serious as they get out of trouble by simply re-running the exact same apt command:
$ apt install -y cacti ... Setting up cacti (1.2.23+ds1-2) ... dbconfig-common: writing config to /etc/dbconfig-common/cacti.conf Creating config file /etc/dbconfig-common/cacti.conf with new version Creating config file /etc/cacti/debian.php with new version ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2). unable to connect to mysql server. error encountered creating user: ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) dbconfig-common: cacti configure: aborted. dbconfig-common: flushing administrative password dpkg: error processing package cacti (--configure): installed cacti package post-installation script subprocess returned error exit status 1 Setting up mariadb-plugin-provider-bzip2 (1:10.11.2-0~exp1) ... Setting up mariadb-plugin-provider-lzma (1:10.11.2-0~exp1) ... Setting up mariadb-plugin-provider-lzo (1:10.11.2-0~exp1) ... Setting up mariadb-plugin-provider-lz4 (1:10.11.2-0~exp1) ... Setting up mariadb-plugin-provider-snappy (1:10.11.2-0~exp1) ... Setting up mariadb-server (1:10.11.2-0~exp1) ... Stopping MariaDB database server: mariadbd. Starting MariaDB database server: mariadbd. Setting up default-mysql-server (1.1.0) ... Processing triggers for libc-bin (2.36-8) ... Processing triggers for ca-certificates (20211016) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for php8.2-cli (8.2.2-3) ... Processing triggers for libapache2-mod-php8.2 (8.2.2-3) ... Errors were encountered while processing: cacti E: Sub-process /usr/bin/dpkg returned an error code (1) $ apt install -y cacti Reading package lists... Done Building dependency tree... Done Reading state information... Done cacti is already the newest version (1.2.23+ds1-2). 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up cacti (1.2.23+ds1-2) ... Determining localhost credentials from /etc/mysql/debian.cnf: succeeded. dbconfig-common: writing config to /etc/dbconfig-common/cacti.conf checking privileges on database cacti for cacti@localhost: user creation needed. granting access to database cacti for cacti@localhost: success. verifying access for cacti@localhost: success. creating database cacti: success. verifying database cacti exists: success. populating database via administrative sql... done. populating database via sql... done. dbconfig-common: flushing administrative password Creating config file /etc/apache2/conf-available/cacti.conf with new version Creating config file /etc/lighttpd/conf-available/20-cacti.conf with new version Loading default cacti templates (may take some time).............. done. Created directory: /var/lib/snmp/cert_indexes apache2_invoke: Enable configuration cacti Reloading Apache httpd web server: apache2. $ mariadb -E -e "SHOW CREATE TABLE version;" cacti *************************** 1. row *************************** Table: version Create Table: CREATE TABLE `version` ( `cacti` char(20) NOT NULL DEFAULT '', PRIMARY KEY (`cacti`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC root@e7fa16a54a88:/build#