PDA

View Full Version : [ubuntu] [SOLVED] Solving A dpkg Parse Error



Charlie91
June 7th, 2008, 06:15 AM
After downloading update packages (I'm using 8.04 version), and just beginning the updating process, power was cut, and the update process was interrupted. When power was restored, the update manager doesn't work, saying that I type 'dpkg --configure -a' to solve the problem. I followed the instruction but there's a parse error...

$ sudo dpkg --configure -a
[sudo] password for ...:
dpkg: parse error, in file `/var/lib/dpkg/updates/0034' near line 1:
field name `

How can I resolve that error? :confused:

iaculallad
June 7th, 2008, 06:27 AM
Display the result of:


cat /var/lib/dpkg/updates/0034

Charlie91
June 7th, 2008, 10:15 AM
$ cat /var/lib/dpkg/updates/0034 showed gibberish (it's a binary data file) so I used cat -Ab /var/lib/dpkg/updates/0034:

1 ,y[+M-h^CM-*M-fM-S^GM-^_/[M-l`M-^EM-;M-ZM-xjM-|M-y"ZM-(#M-m^NM-sUM-^C^X^?M-^AM-^PM-I^AM-pCM-MM-^QTM-^V<^T0M-|M-^O-M-YzM-^X7M-ppM-^AM-MdEM-g^XLM-2^EM-KM-^JM-^NM-}6M-^M-s#M-U^EM-%M-&M-^O'^AM-^FM-8M-^GVM-^KM-h^]M-vM-'L^^M->M-^Vw,lM-^WM-^SM-MM-(M-OM-OM-Cf[M-^J_M-6mYyKcY%M-h3M-kM-^NM-VM-\P'[j^CM-DM-eM-#M-s^R\M-vWM-^E^@M-5lMUM-W-M-:2A<M-9r^GM-tM-YM-8M-^HM-I ^NAM-^DM-^_:&M-^PM-*>M-@M-HJM-^DM-quM-vWM-U\4M-vM-KM-^FM-^Fi^NM-hM-!Zm6]M-$M-^N^DD=bM-^H*M-YM-4^ZV^DM-NM-1M-^WM-ZF5M-]M-Q^CL^ZM-VM-+M-^HM-]1^R5_K^EM-^E^SM-DM-yVvM-^EM-^Z^KM-z}LkM-q`,M-,Q@^S"M-`M-%t>M-DM-b^GuM-bM-=M-wM-t=M-^]M-?M-^FM-@M-_zM-_FM-n5^T^QKV/eM-0vM-8^C<OM-^K#mM-^FM-`M-4@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send the actual file through email?

Charlie91
June 8th, 2008, 04:13 AM
I also did the following to no avail:

sudo dpkg --clear-avail && sudo apt-get update

Partyboi2
June 8th, 2008, 06:53 AM
You could try removing 0026 and then update again.

sudo cp /var/lib/dpkg/updates/0034 /var/lib/dpkg/updates/0034.bak
sudo rm /var/lib/dpkg/updates/0034
sudo apt-get update
sudo apt-get upgrade

Charlie91
June 8th, 2008, 04:20 PM
Thanks Partyboi2 for that answer but it didn't work, but I found the answer! For those interested see this link to linuxquestion (http://www.linuxquestions.org/questions/debian-26/apt-get-dpkg-error-files-list-file-...-missing-final-newline-271118/). And to summarize:

The power cut caused the corruption of some files, causing problems with dpkg, particularly `/var/lib/dpkg/info/openoffice.org-impress.list'. For some reason, dpkg (or apt-get) can't work if some `.list' files are corrupted; I hope such behavior will get corrected. Why not just ignore a bad file and continue on?

To clear the cache, and other things, `sudo apt-get clean' is good to do. `apt-get update' and `apt-get upgrade' will ferret out the offending file (for me it was `/var/lib/dpkg/info/openoffice.org-impress.list'). So, delete that file and then `apt-get upgrade' again. Then it should work.

Purge openoffice.org-impress (it may be another package for others) and Install it again, perhaps the `.list' file will be restored.

Bye for now.

WSD
June 10th, 2008, 01:37 AM
Similar problem fixed as follows:

Problem:
***********
Fetched 18.5MB in 34s (532kB/s)
dpkg: parse error, in file `/var/lib/dpkg/available' near line 1184 package `xserver-xorg-video-amd':
missing version
E: Sub-process /usr/bin/dpkg returned an error code (2)
**************
fixed as shown in below clip
**********
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
evolution evolution-common evolution-plugins firefox firefox-3.0 firefox-3.0-gnome-support firefox-gnome-support
gnome-about gnome-desktop-data initramfs-tools language-pack-en language-pack-en-base language-pack-gnome-en
language-pack-gnome-en-base libgksu2-0 libgnome-desktop-2 libnspr4-0d libnss3-1d libntfs-3g23 libsmbclient ntfs-3g
python-launchpad-bugs samba-common smbclient tzdata ufw xserver-xorg-video-cirrus xulrunner-1.9
xulrunner-1.9-gnome-support yelp
30 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
7 not fully installed or removed.
Need to get 40.1MB of archives.
After this operation, 410kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
*******************