I have mixed wheezy/jessie system. When tried to upgrade cmake from jessie, apt pulled other packages including dpkg which gave error during configure:
root@debian:~# apt-get -t jessie install cmake Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libxmlrpc-core-c3 Use 'apt-get autoremove' to remove it. The following extra packages will be installed: cmake-data dpkg fontconfig install-info libarchive13 libpipeline1 man-db Suggested packages: codeblocks eclipse ninja-build lrzip groff The following NEW packages will be installed: libarchive13 The following packages will be upgraded: cmake cmake-data dpkg fontconfig install-info libpipeline1 man-db 7 upgraded, 1 newly installed, 0 to remove and 791 not upgraded. Need to get 8,200 kB of archives. After this operation, 3,399 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://security.debian.org/ jessie/updates/main fontconfig amd64 2.11.0-6.3+deb8u1 [403 kB] Get:2 http://ftp.de.debian.org/debian/ jessie/main install-info amd64 5.2.0.dfsg.1-6 [193 kB] Get:3 http://ftp.de.debian.org/debian/ jessie/main libpipeline1 amd64 1.4.0-1 [27.9 kB] Get:4 http://ftp.de.debian.org/debian/ jessie/main man-db amd64 2.7.0.2-5 [1,000 kB] Get:5 http://security.debian.org/ jessie/updates/main libarchive13 amd64 3.1.2-11+deb8u2 [270 kB] Get:6 http://ftp.de.debian.org/debian/ jessie/main dpkg amd64 1.17.27 [2,994 kB] Get:7 http://ftp.de.debian.org/debian/ jessie/main cmake amd64 3.0.2-1 [2,384 kB] Get:8 http://ftp.de.debian.org/debian/ jessie/main cmake-data all 3.0.2-1 [929 kB] Fetched 8,200 kB in 9s (845 kB/s) Preconfiguring packages ... (Reading database ... 115145 files and directories currently installed.) Preparing to replace fontconfig 2.9.0-7.1+deb7u1 (using .../fontconfig_2.11.0-6.3+deb8u1_amd64.deb) ... Unpacking replacement fontconfig ... Preparing to replace install-info 4.13a.dfsg.1-10 (using .../install-info_5.2.0.dfsg.1-6_amd64.deb) ... Unpacking replacement install-info ... Processing triggers for man-db ... Setting up install-info (5.2.0.dfsg.1-6) ... (Reading database ... 115145 files and directories currently installed.) Preparing to replace libpipeline1:amd64 1.2.1-1 (using .../libpipeline1_1.4.0-1_amd64.deb) ... Unpacking replacement libpipeline1:amd64 ... Preparing to replace man-db 2.6.2-1 (using .../man-db_2.7.0.2-5_amd64.deb) ... Unpacking replacement man-db ... Preparing to replace dpkg 1.16.18 (using .../dpkg_1.17.27_amd64.deb) ... Unpacking replacement dpkg ... Processing triggers for mime-support ... Setting up dpkg (1.17.27) ... Installing new version of config file /etc/cron.daily/dpkg ... dpkg (subprocess): cannot set security execution context for maintainer script: Invalid argument dpkg: error processing package dpkg (--configure): subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: dpkg E: Sub-process /usr/bin/dpkg returned an error code (1) root@debian:~# dpkg --configure -a Setting up libpipeline1:amd64 (1.4.0-1) ... dpkg (subprocess): cannot set security execution context for maintainer script: Invalid argument dpkg: error processing package libpipeline1:amd64 (--configure): subprocess installed post-installation script returned error exit status 2 Setting up dpkg (1.17.27) ... dpkg (subprocess): cannot set security execution context for maintainer script: Invalid argument dpkg: error processing package dpkg (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of man-db: man-db depends on libpipeline1 (>= 1.3.0); however: Package libpipeline1:amd64 is not configured yet. man-db depends on dpkg (>= 1.16.1~); however: Package dpkg is not configured yet. dpkg: error processing package man-db (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of fontconfig: fontconfig depends on dpkg (>= 1.16.1); however: Package dpkg is not configured yet. dpkg: error processing package fontconfig (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: libpipeline1:amd64 dpkg man-db fontconfig root@debian:~# apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up dpkg (1.17.27) ... dpkg (subprocess): cannot set security execution context for maintainer script: Invalid argument dpkg: error processing package dpkg (--configure): subprocess installed post-installation script returned error exit status 2 Setting up libpipeline1:amd64 (1.4.0-1) ... dpkg (subprocess): cannot set security execution context for maintainer script: Invalid argument dpkg: error processing package libpipeline1:amd64 (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of man-db: man-db depends on libpipeline1 (>= 1.3.0); however: Package libpipeline1:amd64 is not configured yet. man-db depends on dpkg (>= 1.16.1~); however: Package dpkg is not configured yet. dpkg: error processing package man-db (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of fontconfig: fontconfig depends on dpkg (>= 1.16.1); however: Package dpkg is not configured yet. dpkg: error processing package fontconfig (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: dpkg libpipeline1:amd64 man-db fontconfig E: Sub-process /usr/bin/dpkg returned an error code (1) Please help. -- http://markorandjelovic.hopto.org "The only thing necessary for the triumph of evil is that good people do nothing." -- Edmund Burke