59

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:~$ 

&

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

frank@august:~$ 

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

4 Answers 4

106

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.

3
  • 7
    Since attempting to run sudo rm -rf /var/lib/dpkg/updates/0045 is safe and proper but could have disastrous results if one types in a stray space next to any of the /es (especially the first two!), it may be best to warn about this danger or to suggest something like cd /var/lib/dpkg/updates && rm -rf 0045. Good solution though! Mar 25, 2014 at 4:24
  • 4
    In such a situation I'd never use sudo rm -rf [file], but sudo mv [file] /var/tmp. Jan 29, 2017 at 16:40
  • even with sudo access was denied so i had to go to root with sudo -s Thanks, this really helped me though once I was in root.
    – John D
    Oct 24, 2017 at 2:54
15

Try this:

sudo rm -rf /var/lib/dpkg/updates/*
dpkg --configure -a
5
  • 7
    Can you add more details to your answer please? Like what this does and why it does it?
    – Seth
    Jan 4, 2013 at 19:52
  • 2
    What's the difference to @Ten-Coin's ealier answer? Jan 29, 2017 at 16:41
  • @KarlRichter Most likely Ten-Coin's answer will not work if your error is not 0045 but other numbers.
    – 林果皞
    Apr 28, 2018 at 16:52
  • Such a difference doesn't justify a separate answer. You should suggest and improvement to the existing answer instead if the change is so small. Apr 28, 2018 at 16:54
  • Its fix my problem on UBUNTU 18.04 LTS with xfce4 desktop.
    – EsmaeelE
    Aug 10, 2019 at 19:47
11

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
2
  • Thanks for your answer , but it didnt helped me paste.ubuntu.com/1337768
    – Raja G
    Nov 6, 2012 at 17:13
  • This removes the apparently offending file, but in my case that just got me to the next corrupted file. So I just sudo rm /var/lib/dpkg/updates/* and then continues with the clean+update, which worked fine.
    – thoni56
    Sep 17, 2018 at 12:45
7

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .