Damaged /var/lib/dpkg/available

I seem to have somehow corrupted my /var/lib/dpkg/available file, and I don’t see a way out of it. As a result I can’t install or update anything, and it might have gotten the better of me.

dpkg: parse error, in file `/var/lib/dpkg/available' near line 1:
EOF after field name `'
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install. Trying to recover:
dpkg: parse error, in file `/var/lib/dpkg/available' near line 1:
EOF after field name `'

There’s an available-old file in that same directory, but a quick swap wasn’t any good. If I open the files in nano, they look garbled. Of course, that doesn’t necessarily mean they’re damaged, but that’s what I suspect.

I looked around for a solution, but didn’t find much.

No problem. My Killdisk v4.1 disc is working overtime these days. ;)

About these ads

12 Responses to “Damaged /var/lib/dpkg/available”


  1. 1 bapoumba 2007/04/01 at 11:53 AM

    Hello K.Mandla,
    Have you tried dselect update ?

  2. 2 K.Mandla 2007/04/01 at 12:05 PM

    No, I hadn’t seen anything about dselect update. If I can reproduce the garbled files I’ll try that, and see if it helps. I’m not really sure what happened in the first place, which makes it kind of mysterious. Usually, when I break something, I have an idea how I did it. ;)

  3. 3 sebrem 2007/05/23 at 3:12 AM

    Hi, just create an empty /var/lib/dpkg/available, it will be rebuilt, at least here (sid).

  4. 4 eric soukenka 2008/03/13 at 11:12 PM

    awesome i ended up google this saw the simple response “just delete it” worked great computer crashed when doing an update for me causig this.

  5. 5 felipe.lv 2008/06/12 at 9:50 AM

    @eric: it’s actually pretty different to create an empty file than deleting it

  6. 6 tesseracter 2009/02/27 at 3:08 AM

    so, proper course of action:
    > sudo mv /var/lib/dpkg/available /var/lib/dpkg/available.oldBusted
    > sudo touch /var/lib/dpkg/available
    > sudo apt-get update (or something else, this isnt the important part)

  7. 7 netswitch 2009/04/24 at 11:00 PM

    Tested just now and works just fine, thanks tesseracter for the summary.

  8. 8 Fubuntu 2009/05/07 at 6:44 PM

    Try the following:

    dpkg –clear-avail
    aptitude update

    This will download a new copy of available packages,
    hopefully removing corruption in the process.

  9. 9 Fubuntu 2009/05/07 at 6:51 PM

    That’s dpkg dash dash clear-avail
    The blog chews the double dash and converts to a longdash.

     dpkg --clear-avail
    aptitude update 
  10. 10 Fips 2009/10/11 at 7:17 PM

    Thanks for the tips! Had the problem of garbled files whilst running a persistent USB keypen install.

  11. 11 modustollens 2010/12/01 at 4:28 AM

    I had this problem. Spent hours trying to fix it.

    Then I thought – maybe I could overwrite the busted file with a new version; googled the file name. Came up your post did here. Took you advice (see below). Fixed it right away. Wish I had tried this 6 hours ago – i was getting so frustrated i was going to re-install the whole damn OS.

    I think my wifi signal crashed during a package installation – maybe that was how the file got corrupted.

    So:

    THANKS!

    so, proper course of action:
    > sudo mv /var/lib/dpkg/available /var/lib/dpkg/available.oldBusted
    > sudo touch /var/lib/dpkg/available
    > sudo apt-get update (or something else, this isnt the important part)


  1. 1 Damaged /var/lib/dpkg/available (via Motho ke motho ka botho) « La Página de Horus Trackback on 2010/08/04 at 12:16 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,959,852 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: