LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-08-2008, 05:20 AM   #1
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 121

Rep: Reputation: 23
dpkg/apt-get/aptitude broke after I fixed corrupted filesystem


Disaster struck.

Power went out (no, we don't have a UPS) while my wife was working on her computer. The root partition (ext3) took a hit via a corrupted journal. I did manage to fix the filesystem via an alternate superblock, but the fsck command threw a boat load of things in /lost+found, and "jiggled" a few other filenames about a bit, and I seem to have a problem with dpkg/apt-get/aptitude:

Namely, anything I do via dpkg/apt-get/aptitude throws the following error:

/* begin error message */

dpkg: serious warning: files list file for package `libxalan2-java-gcj' missing, assuming package has no files currently installed.

dpkg: serious warning: files list file for package `xserver-xorg-video-all' missing, assuming package has no files currently installed.
dpkg: error processing /var/cache/apt/archives/libxalan2-java-gcj_2.7.1-2_i386.deb (--unpack):
files list file for package `rplay-client' contains empty filename
Errors were encountered while processing:
/var/cache/apt/archives/libxalan2-java-gcj_2.7.1-2_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

/* end error message */

Now, I back up /var/cache/debconf, but that's about it for the dpkg-related files. I'm a bit tired right now, and can't really afford to make any mistakes... It seems to me that the errors are with the dpkg files lists for the packages mentioned.

How would I go about fixing this problem?

((PS: don't suggest that I reinstall the system, it isn't going to happen))
 
Old 10-08-2008, 07:22 AM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,234

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
Download the Debian Reference or Debian Installation manual from Debian.org. There are some chapters about restoring a corrupted package system.

jlinkels
 
Old 10-08-2008, 01:05 PM   #3
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 121

Original Poster
Rep: Reputation: 23
Solution

OK... after getting 2 hours of sleep, having a tooth extracted, and playing RTFM, I came upon one solution that seemed to work for me.

I went to /var/lib/dpkg, backed up the status file

I edited the status file in the following way:

Those packages for which dpkg was having problems in the /var/lib/dpkg/info/ directory, I edited the "Status" entry in the status file from

"Status: install ok installed"

to

"Status: purge ok not-installed"

I then reinstalled the problem packages.

In short, I lied to dpkg and said that the problem packages were not installed, and I reinstalled the package over the existing package.

It seems to have worked for me, thus far.

NOTE: There are probably other solutions to this problem. This one was the simplest one that worked for me under the circumstances

Last edited by kevinbenko; 10-08-2008 at 01:06 PM. Reason: typographical error
 
Old 10-08-2008, 09:35 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,652

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
aptitude reinstall package?
apt-get install --reinstall package?
 
Old 10-08-2008, 10:20 PM   #5
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 121

Original Poster
Rep: Reputation: 23
Like I had said in my original posting, any activity with dpkg/apt-get/aptitude threw the error listed. Attempts to install, reinstall, or remove any package failed because, from what I could gather, /var/lib/dpkg/info/ directory had some inconsistencies with respect to the dpkg status file. The solution I found, listed above, was the only thing that I had found that worked.
 
  


Reply


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
APT/dpkg errors! /var/lib/dpkg/status bassclarinet Debian 16 12-01-2011 10:24 AM
Debian 4 Stable - dpkg/apt-get/aptitude - Database reading issue? Brian Ryans Debian 1 05-18-2007 05:09 AM
What is the difference between dpkg and aptitude/apt-get? Akhran Debian 13 03-14-2006 12:33 AM


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

Main Menu
Advertisement
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