what should I do if status file is corupted

Asked by Esa-Petri

My system wont install any packages because my /var/lib/dpkg/status is corrupted. Is there any other way to repair it? I would not like to install my system again. when I run sudo dpkg --configure -a
I gain something like this:

dpkg: writing mistake in file `/var/lib/dpkg/status' near line 1:
 after cell name `ile' should be double point

I tried to translate it to English. by double point I mean this symbol ":"

Question information

Language:
English Edit question
Status:
Solved
For:
dpkg Edit question
Assignee:
No assignee Edit question
Solved by:
Esa-Petri
Solved:
Last query:
Last reply:
Revision history for this message
Rodrigo Donado (frezeeer) said :
#1

Hi:

try doing:
sudo dpkg --clear-avail
sudo apt-get update

Revision history for this message
Esa-Petri (esapete) said :
#2

Thanks for help. but it didn't work

esa-petri@GOD-IS-laptop:~$ sudo dpkg --clear-avail
Password:
esa-petri@GOD-IS-laptop:~$ sudo apt-get update
...
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
esa-petri@GOD-IS-laptop:~$ sudo dpkg --configure -a
dpkg: writing mistake in file `/var/lib/dpkg/status' near line 1:
after cell name `ile' should be double point

and same problem again

Revision history for this message
Esa-Petri (esapete) said :
#3

could it be possible to reinstall dpkg
like from source

Revision history for this message
Esa-Petri (esapete) said :
#4

I successfully installed from source and by erasing part of status "sudo dpkg --configure -a" won't give erors. but now I need install every package again :-( is there any package whits includes basic packages for kubuntu or ubuntu

Revision history for this message
Esa-Petri (esapete) said :
#5

well anyway I try to survive from here on

Revision history for this message
rayhoskins (ray-hoskins) said :
#6

I have this same issue, and have never had it in earlier versions of Ubuntu. I need a way around it.

Revision history for this message
Esa-Petri (esapete) said :
#7

there are ways to rebuild database. I found this from google
http://linuxmafia.com/faq/Debian/package-database-rebuild.html.
but before trying that try if there is status-old in /var/lib/dpkg/. if is just name it as status. but before renaming make copy of it to somewhere for the case that something goes wrong.
here is another talk about this topic
http://www.debuntu.org/2006/05/12/48-debian-ubuntu-weakness-to-filesystem-corruption-recovery
and another script to try
http://www.debian.org/doc/manuals/reference/examples/debian-package-database-rebuild
I hope those works other wise you must reinstall.