skip to Main Content

Something is definitely discombobulated and it’s related to dpkg. No idea what caused it. Here are the symptoms:

The commands sudo apt upgrade, sudo apt install <any package>, sudo apt remove <any package> and sudo apt install -f all fail with the following error:

Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info.bak': Is a directory
dpkg: error processing package dpkg (--configure):
 installed dpkg package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 dpkg

sudo apt update runs without issue.

Here is the output of sudo dpkg --configure -a, although I don’t have the technical know how to make heads or tails of what it means:

Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info.bak': Is a directory
dpkg: error processing package dpkg (--configure):
 installed dpkg package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of libdpkg-perl:
 libdpkg-perl depends on dpkg (>= 1.18.11); however:
  Package dpkg is not configured yet.

dpkg: error processing package libdpkg-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dpkg-dev:
 dpkg-dev depends on libdpkg-perl (= 1.21.1ubuntu2); however:
  Package libdpkg-perl is not configured yet.

dpkg: error processing package dpkg-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of pkg-config:
 pkg-config depends on libdpkg-perl; however:
  Package libdpkg-perl is not configured yet.

dpkg: error processing package pkg-config (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libglib2.0-dev:amd64:
 libglib2.0-dev:amd64 depends on pkg-config; however:
  Package pkg-config is not configured yet.

dpkg: error processing package libglib2.0-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libdbus-1-dev:amd64:
 libdbus-1-dev:amd64 depends on pkg-config; however:
  Package pkg-config is not configured yet.

dpkg: error processing package libdbus-1-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for install-info:
 install-info depends on dpkg (>= 1.16.1); however:
  Package dpkg is not configured yet.

dpkg: error processing package install-info (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for sgml-base:
 sgml-base depends on dpkg (>= 1.16.4); however:
  Package dpkg is not configured yet.

dpkg: error processing package sgml-base (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 dpkg
 libdpkg-perl
 dpkg-dev
 pkg-config
 libglib2.0-dev:amd64
 libdbus-1-dev:amd64
 install-info
 sgml-base

I saw another thread on a similar topic that suggested the output of stat / /dev /var may be useful (though I’m not sure what for). Here it is anyway:

  File: /
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d  Inode: 2           Links: 20
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-06-11 12:23:55.966935477 +1000
Modify: 2022-03-28 17:02:40.336120240 +1100
Change: 2022-06-11 12:15:41.459498623 +1000
 Birth: 2020-12-31 15:04:54.000000000 +1100
  File: /dev
  Size: 4720        Blocks: 0          IO Block: 4096   directory
Device: 5h/5d   Inode: 1           Links: 21
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-06-11 11:59:38.006513248 +1000
Modify: 2022-06-11 11:59:17.901323228 +1000
Change: 2022-06-11 11:59:17.901323228 +1000
 Birth: -
  File: /var
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d  Inode: 5767169     Links: 15
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-04-28 09:42:56.569785898 +1000
Modify: 2021-08-18 10:28:44.011762167 +1000
Change: 2021-08-18 10:28:44.011762167 +1000
 Birth: 2020-12-31 15:04:58.512613837 +1100

Running sudo chown root / did not make any difference.

My system:

                          ./+o+-       mblizzard@HP248G1
                  yyyyy- -yyyyyy+      OS: Ubuntu 22.04 jammy
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 5.15.0-23-generic
           .++ .:/++++++/-.+sss/`      Uptime: 1h 5m
         .:++o:  /++++++++/:--:/-      Packages: 4191
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 5.1.16
       .:+o:+o/.          `+sssoo+/    Resolution: 2646x1024
  .++/+:+oo+o:`             /sssooo.   DE: Xfce
 /+++//+:`oo+o               /::--:.   WM: Xfwm4
 +/+o+++`o++o               ++////.   WM Theme: Sweet-Ambar
  .++.o+++oo+:`             /dddhhh.   GTK Theme: Sweet-Dark [GTK2]
       .+.o+oo:.          `oddhhhh+    Icon Theme: TheOne
        +.++o+o``-````.:ohdhhhhh+     Font: Noto Sans 10
         `:o+++ `ohhhhhhhhyo++os:      Disk: 791G / 916G (91%)
           .o:`.syhhhhhhh/.oo++o`      CPU: Intel Core i5-4200U @ 4x 2.6GHz [40.0°C]
               /osyyyyyyo++ooo+++/     GPU: Mesa Intel(R) HD Graphics 4400 (HSW GT2)
                   ````` +oo+++o:     RAM: 4823MiB / 7871MiB
                          `oo++.      

Thanks in advance!

3

Answers


  1. Chosen as BEST ANSWER

    Solved my own problem by running sudo mv /var/lib/dpkg/info/dpkg* /tmp, followed by sudo apt install -f and sudo dpkg --configure -a.

    Have a read of https://itsfoss.com/dpkg-returned-an-error-code-1/ to see why that works.


  2. So, this answer will not be the most helpful ever, but I experienced a similar problem today, where ‘out of the blue’ I got the message about some package not yet being configured.

    The command sudo apt install -f initially didn’t work, though. Only after I ran sudo dpkg --configure -a and then the former command, all seemed well again.

    It’s still a mystery to me, how all this came to be, but I’m glad Mblizzard found the solution, that also worked in my case. Thanks!

    Note: I’m using Pop!_OS 22.04 and I noticed the first signs of trouble when the Pop!_Shop app wouldn’t update installed applications anymore. Instead it just closed without any notice.

    Login or Signup to reply.
  3. There might be a symbolik link inside /var/lib/dpkg with name dpkg pointing to this folder. Removing it before configuring helps

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search