Been trying to install git-core package for almost more than half a day now. Every time I do, I get this error:
dpkg: error: parsing file '/var/lib/dpkg/available' near line 0:
newline in field name `../../../../../share/pyshared/UpdateManager/Core/__init__.py'
I've also tried running sudo apt-get update
and sudo apt-get install --fix-missing
. Even tried rebooting and cleaning the apt-get cache, still doesnt work.
The problem is that your
/var/lib/dpkg/available
file is damaged.This is not necessarily related to the git or git-core packages. Try to install any other package and they will fail too.
To fix this you have to delete/clear the file using the command:
then rebuild the file using the command:
Now you should be able to install git and git-core.
From the below error,it was clearly shown that your
/var/lib/dpkg/available
file was corrupted.Solution for the above problem is to replace the current
/var/lib/dpkg/available
file with another/var/lib/dpkg/available-old
backup file.Now try,