LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 03-09-2004, 01:34 PM   #1
bassclarinet
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Rep: Reputation: 0
APT/dpkg errors! /var/lib/dpkg/status


Hiya.
Ive recently installed a debian system, and mainly its going well. The APT system is indeed great. BUT recently it stopped working. whenever i try to install anything, theres a 'parse error' when reading the package lists (similar to that below). For a short term measure, I could remove the particular source to which it refered, and use different mirroirs. Now ive been forced to sort out the problem as it seems the problem is with the dpkg status file (/var/lib/dpkg/status). E.g when running 'apt-get update' I get this error:

Get:1 http://security.debian.org stable/updates/main Packages [179kB]
Get:2 http://security.debian.org stable/updates/main Release [110B]
Fetched 179kB in 1m4s (2790B/s)
Reading Package Lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.

any suggestions?

dav
 
Old 03-09-2004, 02:11 PM   #2
augamecock
Member
 
Registered: Feb 2002
Location: Atlanta, GA
Distribution: Debian
Posts: 78

Rep: Reputation: 15
Try setting your Cache-Limit higher in apt.conf.

Found this web page that explains.
 
Old 03-11-2004, 01:56 AM   #3
bassclarinet
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the reply. Well, I couldnt find a file at /etc/apt/apt.conf. So I created one with the line as given.
APT::Cache-Limit "42123456";

There was a file "/etc/apt/apt.conf.d/70debconf" so I added the line there as well. Unfortunatly, this did not stop the error. So, I went to /var/lib/dpkg/ and renamed "status-2" to "status". This sorted out the prob for a while. I could run "apt-get update" without any probs. So, I ran "apt-get -f install" a few times (kept getting an error from "xfonts-scalable"). Now, its gone back to /var/lib/dpkg/status, and i get this out put:

#apt-get -f install
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
gcc-3.3-base libc6 libc6-dev libdb1-compat libgcc1 libstdc++5
linux-kernel-headers locales x-window-system-core xfonts-scalable
xlibmesa3-gl xlibmesa3-glu
The following packages will be REMOVED:
libnss-db xlibmesa3
The following NEW packages will be installed:
gcc-3.3-base libdb1-compat libstdc++5 linux-kernel-headers xfonts-scalable
xlibmesa3-gl xlibmesa3-glu
5 packages upgraded, 7 newly installed, 2 to remove and 1019 not upgraded.
1 packages not fully installed or removed.
Need to get 0B/18.5MB of archives. After unpacking 12.1MB will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
dpkg: parse error, in file `/var/lib/dpkg/status' near line 28404 package `xfonts-scalable':
missing version
E: Sub-process /usr/bin/dpkg returned an error code (2)

btw, I am using Debian 3.2r2 Woody non-US + some packages from testing, on a PII 400 Mhz, 370 MB mem.
is this due to an error in the xfonts package, or can I fix it?


dav
 
Old 03-18-2004, 09:58 AM   #4
bassclarinet
LQ Newbie
 
Registered: Jul 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Hi. Ok, I now see that my question was quite silly. Investigating I found that "/var/lib/dpkg/status" had been corrupted. To correct this, all I had to do was rename "status-old" (the backup) to status. This has sorted the problem and APT is back to working again.

Dav
 
Old 07-04-2005, 04:12 AM   #5
eye69
LQ Newbie
 
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
Not a stupid question at all

Since I made the same mistake, I don't think that your question was stupid.
I hadn't seen that there was a status-old file, so you helped me out.
 
Old 06-09-2007, 07:08 PM   #6
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
I know this is an old thread but I just ran into the same problem. I tried renaming status-old to status and still get:


Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status

If remove the file completely dpkg/apt has no clue what packages I have installed. I havent had a power outage or anything weird happen that I know of. Just did a d-u yesterday with no problems.
 
Old 06-09-2007, 07:33 PM   #7
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Well, I suppose you could plough through the status file and fix the error manually. Without knowing exactly how the package header is messed up there is no easy way to search for it. (Status file is usually in region of 20000 lines, so maybe not a good idea)

Or

You could try one of the older status backups. Look for /var/backups/dpkg.status.* and see if one of these work.
 
Old 06-11-2007, 10:35 AM   #8
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
Found dpkg -l which was able to show me the messed up lines. Seems a packages xdialog had part of the description in German and dpkg didn't like that. Lines 66200 through 66250 were messed up, corrected those and w00t it worked as usual.
 
Old 06-11-2007, 04:02 PM   #9
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
Cool. Glad you got it sorted. Purely out of interest, how did dpkg -l show you the error. I would have thought that dpkg -l would not function with a corrupt status file...

I'm envisioning something like:

Code:
[...]
normal package - description
normal package - description
normal package - description
BLARRGH purge meeeeee!
normal package - description
normal package - description
normal package - description
[...]
hehehe
 
Old 06-12-2007, 08:20 PM   #10
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
Its been a few days but the message it showed was something along the line of "error near line 66250 after xdialog should be a colon" and so on. I just deleted the entire description and reinstalled the package and all was good.
 
Old 06-13-2007, 06:13 AM   #11
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
I had a kind of problem like this. Two years ago I made a stupid mistake and erased /var /boot /etc and some of /bin ("some" because I was quick enough to press ctrl-c). Deadly rm with root account..
I didn't want to reinstall. I had a backup of /etc as usual.
To reconstruct the /var directory (and especially the apt database), I used a method given in debian reference:
Every package installs something in /usr/share/doc. From this directory that I still had, I reconstructed the list of installed packages in /var (using dpkg-set-selection) and just asked the system to update and then reinstall everything for getting a clean /bin.
After a few hours of fighting, everything was back again.
One time I also tried getting back from the backup /var/backup but this is not updated enough (for an debian unstable system) and I had a few mismatch (packages seen as installed while there are not or vice-versa).

Last edited by nx5000; 06-13-2007 at 06:15 AM.
 
Old 01-28-2008, 03:44 AM   #12
henriquemaia
LQ Newbie
 
Registered: May 2004
Location: Portugal, Castelo Branco
Distribution: Ubuntu
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by Daws View Post
Well, I suppose you could plough through the status file and fix the error manually. Without knowing exactly how the package header is messed up there is no easy way to search for it. (Status file is usually in region of 20000 lines, so maybe not a good idea)

Or

You could try one of the older status backups. Look for /var/backups/dpkg.status.* and see if one of these work.
Thanks for this suggestion. I had a corrupt status file (don't even know why) and your hint did the trick.

Last edited by henriquemaia; 01-28-2008 at 04:18 AM.
 
Old 08-17-2008, 11:25 AM   #13
devkinandan.bhatt
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 1
problem with /var/lib/dpkg/status

I myself faced this problem by some how i fix it. You do the same thing
here we gooooooooo.
we are at root
1. mv /var/lib/dpkg/status __/var/lib/dpkg/status_bak
2. cp /var/backups/dpkg.status.<any latest number>.gz __/var/lib/dpkg/
4. gunzip -d /var/lib/dpkg/dpkg.status.<any latest number>.gz
5. mv /var/lib/dpkg/dpkg.status.<the number in third step> __/var/lib/dpkg/status
6. apt-get updates

I hope this can fix your problem buddy

Last edited by devkinandan.bhatt; 08-17-2008 at 11:39 AM. Reason: mis the tag
 
Old 01-31-2009, 07:33 PM   #14
lukewpatterson
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Thanks devkinandan.bhatt!

Your instructions fixed the problem.
 
Old 04-12-2009, 06:29 PM   #15
mat1111fun
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Talking

Quote:
Originally Posted by bassclarinet View Post
Hi. Ok, I now see that my question was quite silly. Investigating I found that "/var/lib/dpkg/status" had been corrupted. To correct this, all I had to do was rename "status-old" (the backup) to status. This has sorted the problem and APT is back to working again.

Dav
I yousing ifile,if thats not wath im sussposed to have that tll me,i tried to rename status-old to status but it said error cn not rename this
 
  


Reply

Tags
apt-get, corrupted, dpkg, status, working


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) phreakshew Linux - Newbie 16 02-15-2012 12:28 PM
dpkg is dead! error in /var/lib/dpkg/available dezert_fox Debian 4 11-22-2011 10:28 AM
dpkg -- what does a status of 'rc' mean? stefanlasiewski Debian 6 05-13-2009 09:33 AM
How can I get rid of dpkg apt-get errors? jon_k Linux - Software 2 03-25-2005 01:25 PM
dpkg unable to access status area adamsjw2 Debian 3 02-06-2004 05:32 AM


All times are GMT -5. The time now is 03:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration