LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 12-05-2011, 12:53 AM   #1
Shum
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Rep: Reputation: 0
Broken dpkg. Empty /var/lib/dpkg/available file.


When trying to use a third party repository I somehow cleared my /var/lib/dpkg/available and /var/lib/dpkg/status files.

I found this script which looks like it can restore my status file however it needs a populated available file to work.

Everything I've found on the web says I need to run dpkg --update-avail to repopulate my available file however this doesn't work for me. I just get
Code:
Replacing available packages info, using /var/lib/dpkg/available.
Information about 0 packages was updated.
and the file remains empty.

Any ideas?
 
Old 12-05-2011, 02:06 AM   #2
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 515

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Shum View Post
When trying to use a third party repository I somehow cleared my /var/lib/dpkg/available and /var/lib/dpkg/status files.
Huh? How the hell did that happen?
I have never encountered anything like this (i had broken packages in status, but i could manually clear them from it as a last resort, but never ever an empty status or available files).
You should post what you did exactly.

A possible workaround is detailed here:

https://lists.ubuntu.com/archives/ub...ne/081465.html

The idea is to put a character (an empty character is enough) in the file (both status and available) because they are really empty (dont contain any character at all), they might not be repopulated.

Code:
echo "" > /var/lib/dpkg/available
With root rights.
Let us know if it works (or not).

Last edited by gradinaruvasile; 12-05-2011 at 02:08 AM.
 
Old 12-05-2011, 02:10 AM   #3
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 515

Rep: Reputation: 102Reputation: 102
Huh? How the hell did that happen?
I have never encountered anything like this (i had broken packages in status, but i could manually clear them from it as a last resort, but never ever an empty status or available files).
You should post what you did exactly.

A possible workaround is detailed here:

https://lists.ubuntu.com/archives/ub...ne/081465.html

The idea is to put a character (an empty character is enough) in the file (both status and available) because they are really empty (dont contain any character at all), they might not be repopulated.

Code:
echo "" > /var/lib/dpkg/available
With root rights.
Let us know if it works (or not).

PS every command related to these files needs root rights (sudo).
 
Old 12-05-2011, 11:21 AM   #4
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
Copy the backup file.

Code:
cp /var/lib/dpkg/available-old > /var/lib/dpkg/available
 
Old 12-05-2011, 09:32 PM   #5
Shum
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Original Poster
Rep: Reputation: 0
Specifically I did this.

I've tried
Code:
echo "" > /var/lib/dpkg/available
and then ran dpkg --update-avail, but I get the same result.

My available-old file is also empty and the backup status files in /var/backup are all from the same date a long time ago.

How exactly does dpkg know what to populate available with? The man page says something about a Packages-file being copied in its place but how am I supposed to get this file? Is dpkg supposed to download it automatically from the Debian servers or something?
 
Old 12-05-2011, 09:45 PM   #6
Shum
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Original Poster
Rep: Reputation: 0
Specifically I did this.

I've tried
Code:
echo "" > /var/lib/dpkg/available
and then ran dpkg --update-avail, but I get the same result.

My available-old file is also empty and the backup status files in /var/backup are all from the same date a long time ago.

How exactly does dpkg know what to populate available with? The man page says something about a Packages-file being copied in its place but how am I supposed to get this file? Is dpkg supposed to download it automatically from the Debian servers or something?
 
Old 12-05-2011, 09:51 PM   #7
Shum
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Original Poster
Rep: Reputation: 0
Figured it out.

I had to download the Packages file manually from the Debian server and then run dpkg --update-avail on that file.

So the entire process was:
Code:
wget http://ftp.iinet.net.au/pub/debian/debian/dists/stable/main/binary-armel/Packages.bz2
bunzip2 Packages.bz2
dpkg --update-avail Packages
Then run that previously mentioned script to restore my status file.

Simple eh?
 
  


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 09:24 AM
dpkg is dead! error in /var/lib/dpkg/available dezert_fox Debian 4 11-22-2011 10:28 AM
/var/lib/dpkg/status corrupted irahkob Linux - Newbie 2 11-06-2011 05:40 PM
could not get lock /var/lib/dpkg/ netstat Debian 1 09-08-2008 08:52 PM


All times are GMT -5. The time now is 01:45 AM.

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