0

I'm running Ubuntu 14.04 from a liveUSB due to a problem with my HDD. Today I was trying to install Steam, but the installation failed every time. Some testing later, I noticed every installation of anything at all fails now, because of dpkg throwing the following error:

dpkg: error: parsing file '/var/lib/dpkg/available' near line 31:
 missing package name
E: Sub-process /usr/bin/dpkg returned an error code (2)

I also can't seem to manage to uninstall and reinstall dpkg, but that may just be my poor Linux skillz.

Any ideas why this is happening, and how to fix it?

Eden Landau
  • 103
  • 5

2 Answers2

1

The packages file is corrupted. You can fix them with the steps below as discussed in this post

sudo dpkg --clear-avail

and the rebuild using

sudo apt-get update
OdinRW
  • 632
  • 6
  • 12
0

For me, i simply just replace the current corrupted available file with the old one like this

 #rename the corrupted file to available.crpt
 sudo mv /var/lib/dpkg/available /var/lib/dpkg/available.crpt
 #now recreate the available.old file to the current required one.
 sudo cp /var/lib/dpkg/available.old /var/lib/dpkg/available 
 #update the package list 
 sudo apt-get update

And that is how i solved mine. chap chap

Zuko
  • 1,247
  • 11
  • 12