dpkg: error: parsing file '/var/lib/dpkg/updates/0045' near line 0:

I am getting this error in Ubuntu 12.04 , while doing the below operation.

frank@august:~$ sudo apt-get install ttf-mscorefonts-installer
[sudo] password for frank: 
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct    the problem. 
frank@august:~$ sudo dpkg --configure -a
dpkg: error: parsing file '/var/lib/dpkg/updates/0045' near line 0:
 newline in field name `#padding'


frank@august:~$ head /var/lib/dpkg/updates/0045


I can’t see where is the error , help me to solve this.
Thank you.

Asked By: rɑːdʒɑ


It seems that status file corrupted,To fix this you have to delete/clear the file using the command.

sudo dpkg --clear-status

(NB: the –clear-status option is not available anymore. The printout from ‘dpkg -?’ does not suggest a clear replacement.
then rebuild the file using the command:

sudo apt-get update
Answered By: KK Patel

Looks like the file is corrupted. Suggest you do the following ( pls do take a backup and do it at ur risk 😉 )

sudo rm /var/lib/dpkg/updates/000*
sudo apt-get clean
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
Answered By: gnuyoga

Ok I have solved the issue myself.

I ran these two commands in terminal (CTRL+ALT+T):

cd /var/lib/dpkg/updates && rm -rf 0045
sudo dpkg --configure -a

And my issue was solved.

Answered By: rɑːdʒɑ

Try this:

sudo rm -rf /var/lib/dpkg/updates/*
dpkg --configure -a
Answered By: ashish
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.