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

Asked by chitko

/tmp/dpkg$ sudo apt-get install --reinstall dpkg
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 45 not upgraded.
Need to get 0 B/1,954 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: parse error, in file '/var/lib/dpkg/status' near line 90 package 'python-pkg-resources':
 `Depends' field, invalid package name `python:any': character `:' not allowed (only letters, digits and characters `-+._')
E: Sub-process /usr/bin/dpkg returned an error code (2)

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the following terminal commands:

uname -a
lsb_release -a
dpkg --version
apt-cache policy dpkg

Revision history for this message
chitko (saintjohn769) said :
#2

ck@ck:~$ uname -a
Linux ck 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ck@ck:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
ck@ck:~$ dpkg --version
Debian `dpkg' package management program version 1.15.5.6ubuntu2 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
See dpkg --license for copyright and license details.
ck@ck:~$ apt-cache policy dpkg
dpkg:
  Installed: 1.17.5ubuntu5.3
  Candidate: 1.17.5ubuntu5.3
  Version table:
 *** 1.17.5ubuntu5.3 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.17.5ubuntu5 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
ck@ck:~$

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

For whatever reason you are running an outdated version of dpkg (1.15.5.6ubuntu2 - a version used in ubuntu 10.04 lucid lynx), although according to apt you should have version 1.17.5ubuntu5.3 installed.

What is the output of

which dpkg
/usr/bin/dpkg --version

Revision history for this message
chitko (saintjohn769) said :
#5

ck@ck:~$ cd /usr/bin/dpkg
bash: cd: /usr/bin/dpkg: Not a directory
ck@ck:~$ sudo /usr/bin/dpkg --version
Debian `dpkg' package management program version 1.15.5.6ubuntu2 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
See dpkg --license for copyright and license details.
ck@ck:~$ dpkg --version
Debian `dpkg' package management program version 1.15.5.6ubuntu2 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
See dpkg --license for copyright and license details.
ck@ck:~$

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

Apparently you have overwritten the dpkg executable /usr/bin/dpkg with a outdated version that lacks multiarch support.

If you have a backup copy available from the time before the file was overwritten, you can restore that one, and the package management should work again.

If you don't have a backup copy to restore, you will have to apply some manual tricks, because installing the current version of dpkg with the package management tools cannot work due to the problem with dpkg.

The following steps might work:
download the dpkg package in the architecture of your system (amd64), version 1.17.5ubuntu5.3, e.g. from http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.3_amd64.deb
extract the dpkg executable from the .deb file
manually move that file where it belongs
try using the package management tools to re-install dpkg with "sudo apt-get..."

Revision history for this message
chitko (saintjohn769) said :
#7

apt-cache policy dpkg
dpkg:
  Installed: (none)
  Candidate: 1.17.5ubuntu5.3
  Version table:
     1.17.5ubuntu5.3 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     1.17.5ubuntu5 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
apt-get update; apt-get upgrade
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 21%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 43%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 65%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 86%E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
Extracting templates from packages: 100%
dpkg: parse error, in file '/var/lib/dpkg/available' near line 106 package 'python-pkg-resources':
 `Depends' field, invalid package name `python:any': character `:' not allowed (only letters, digits and characters `-+._')
E: Sub-process /usr/bin/dpkg returned an error code (2)

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

It seems that there is still the old dpkg executable running.
What steps have you executed to reach that output? Without that information your output is rather meaningless.

Can you help with this problem?

Provide an answer of your own, or ask chitko for more information if necessary.

To post a message you must log in.