error when running dpkg (or dependant apt tools)

Asked by seanlynch on 2009-06-15

Binary package hint: dpkg

specific error when running dpkg or related apt tools:

root@losalamos:/home/sean01# dpkg --configure -a
dpkg: parse error, in file `/var/lib/dpkg/status' near line 21450 package `cheese':
 field name `D"' must be followed by colon
root@losalamos:/home/sean01#

cut from file /var/lib/dpkg/status:

Package: cheese
Status: install ok installed
Priority: optional
Section: gnome
Installed-Size: 5084
Maintainer: Ubuntu Desktop Team <email address hidden>
Architecture: i386
Version: 2.26.0-0ubuntu1
Replaces: cheese-hildon
Depends: libatk1.0-0 (>= 1.20.0), libbonobo2-0 (>= 2.15.0), libc6 (>= 2.4), libcairo2 (>= 1.4.0), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.78), libebook1.2-9 (>= 2.26.0), libedataserver1.2-11 (>= 2.26.0), libfontconfig1 (>= 2.4.0), libfreetype6 (>= 2.2.1), libgconf2-4 (>= 2.13.5), libglib2.0-0 (>= 2.16.0), libgnome-desktop-2-11 (>= 1:2.25.90), libgstreamer-plugins-base0.10-0 (>= 0.10.0), libgstreamer0.10-0 (>= 0.10.20), libgtk2.0-0 (>= 2.16.0), libhal1 (>= 0.5.8.1), liborbit2 (>= 1:2.14.10), libpango1.0-0 (>= 1.22.0), librsvg2-2 (>= 2.22.3), libsoup2.4-1 (>= 2.25.4), libstartup-notification0 (>= 0.8-1), libxml2 (>= 2.6.27), zlib1g (>= 1:1.1.4), gconf2 (>= 2.10.1-2), gstreamer0.10-plugins-base (>= 0.10.20), gstreamer0.10-plugins-good (>= 0.10.8), gstreamer0.10-x (>= 0.10.20)
Suggests: nautilus-sendto
Conflicts: cheese-hildon
D"

removing the final line results in all packages broken error message.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: dpkg 1.14.24ubuntu1
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: dpkg
Uname: Linux 2.6.30-020630-generic i686

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dpkg Edit question
Assignee:
No assignee Edit question
Solved by:
seanlynch
Solved:
Last query:
Last reply:
seanlynch (sean-seanlynch) said : #1
Philip Muškovac (yofel) said : #2

I'm curious as for why your status file got broken, but for now try replacing

D"^@^@^@{WþÿeWþÿºWþÿ°^@^N^@éf"^@^@^@^@àb<9f>þÿÿÿÑCþÿÑCþÿ^@À¿þðçf¿²çf¿^@^@^@^P^Aþ¿þf^A^@^@^A^_7^W>Yþÿ^@^@^@^@ÂAþÿ^@^@^A^_7^WDBþÿ^@^Aþÿ^A^_7^GÔBþÿ^B^A¨D^@ø¿þ{WþÿeWþÿ§Wþÿ^@ø¿þ^D^@þÿ«Eþÿ^B^@þÿ®AIPª@þÿ provides some graphical effects in order to please the
 users play instinct.

with the correct text:

Description: A tool to take pictures and videos from your webcam
 Cheese is a cheesy program to take pictures and videos from your web
 cam. It also provides some graphical effects in order to please the
 users play instinct.

Chris Coulson (chrisccoulson) said : #3

Your status file is corrupt, which is likely due to a hardware issue. That's not a bug, so I'm converting this in to a user question instead.

seanlynch (sean-seanlynch) said : #4

I have replaced the description as described by Phillip Muskovac.

The abnormal termination at line 21450 is gone when I run the "dpkg --configure -a" command,
but synaptic now reports
"You have 779 broken packages on your system!"

So the file corruption must have truncated some status data. I then issued the command:
"apt-get -f install" with no package name

much output....
The following packages will be upgraded:
  libxcb1 libxcb1-dev
2 upgraded, 819 newly installed, 3 to remove and 2 not upgraded.
Need to get 544MB/590MB of archives.
After this operation, 1902MB of additional disk space will be used.
Do you want to continue [Y/n]?
Y

much downloading and installing...
E: Internal Error, Could not perform immediate configuration (2) on libc6

I'll try a few more things and report back on my progress

seanlynch (sean-seanlynch) said : #5

As root I went to directory /var/lib/dpkg and made a backup of status:

mv ./status ./status.backup

Then I went to /var/backups and looked for old copies of the dpkg status file
the most recent is not compressed, and the older ones are compressed:

root@losalamos:/home/sean01# cd /var/backups/
root@losalamos:/var/backups# ls -la dpkg.status*
-rw-r--r-- 1 root root 2368481 2009-06-14 07:16 dpkg.status.0
-rw-r--r-- 1 root root 646974 2009-06-13 09:53 dpkg.status.1.gz
-rw-r--r-- 1 root root 645234 2009-06-12 12:54 dpkg.status.2.gz
-rw-r--r-- 1 root root 644149 2009-06-10 10:32 dpkg.status.3.gz
-rw-r--r-- 1 root root 643891 2009-06-10 08:50 dpkg.status.4.gz
-rw-r--r-- 1 root root 643982 2009-06-09 08:46 dpkg.status.5.gz
-rw-r--r-- 1 root root 644909 2009-06-07 14:57 dpkg.status.6.gz

the '0' generation had the same error as my most recent file (they are probably exact copies)
the -1 generation (dpkg.status.1.gz) looked clean.

I untarred and copied to the /var/lib/dpkg as 'status'

I ran 'dpkg --configure -a'

sudo aptitude update
sudo aptitude -f full-upgrade

now it looks good

seanlynch (sean-seanlynch) said : #6

As root I went to directory /var/lib/dpkg and made a backup of status:

mv ./status ./status.backup

Then I went to /var/backups and looked for old copies of the dpkg status file
the most recent is not compressed, and the older ones are compressed:

root@losalamos:/home/sean01# cd /var/backups/
root@losalamos:/var/backups# ls -la dpkg.status*
-rw-r--r-- 1 root root 2368481 2009-06-14 07:16 dpkg.status.0
-rw-r--r-- 1 root root 646974 2009-06-13 09:53 dpkg.status.1.gz
-rw-r--r-- 1 root root 645234 2009-06-12 12:54 dpkg.status.2.gz
-rw-r--r-- 1 root root 644149 2009-06-10 10:32 dpkg.status.3.gz
-rw-r--r-- 1 root root 643891 2009-06-10 08:50 dpkg.status.4.gz
-rw-r--r-- 1 root root 643982 2009-06-09 08:46 dpkg.status.5.gz
-rw-r--r-- 1 root root 644909 2009-06-07 14:57 dpkg.status.6.gz

the '0' generation had the same error as my most recent file (they are probably exact copies)
the -1 generation (dpkg.status.1.gz) looked clean.

I untarred and copied to the /var/lib/dpkg as 'status'

I ran 'dpkg --configure -a'

sudo aptitude update
sudo aptitude -f full-upgrade

now it looks good

rajayoganand (rajaol) said : #7

Please try the following I think it will help (if you are not root then add sudo in front of the commands)

mv /var/lib/dpkg/status /var/lib/dpkg/status.corrupted

touch /var/lib/dpkg/status

mv /var/lib/dpkg/available /var/lib/dpkg/available.corrupt

touch /var/lib/dpkg/available

dpkg --configure -a

Thanks Ubuntu

rajayoganand (rajaol) said : #8

The last answer was a wrong entry from my side.

I have done manual changes to these files to remove the errors in the file.

Thanks and sorry for wrong answer here.

Thanks Ubuntu