error: parsing file '/var/lib/dpkg/updates/0001' near line 0: newline in field name `#padding'

20,425

Solution 1

Make a backup and remove the /var/lib/dpkg/updates/0001 via

sudo mv /var/lib/dpkg/updates/0001 /var/lib/dpkg/updates/0001.X

After that

sudo dpkg --configure -a
sudo apt-get install -f

Solution 2

here's how i fixed this problem .. first i removed the whole updates directory ..

rm -r /var/lib/dpkg/updates

after that create a new updates directory

mkdir /var/lib/dpkg/updates

and finally

sudo dpkg --configure -a
Share:
20,425

Related videos on Youtube

user332660
Author by

user332660

Updated on September 18, 2022

Comments

  • user332660
    user332660 over 1 year

    I was try to install mono using the following command:

    sudo apt-get install mono-*
    

    I closed the terminal while it was installing. I restarted the install, and I got the error message:

    Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
    

    I so far tried running these commands:

    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock
    

    I am now getting the following error message:

    dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
    

    I then used sudo dpkg --configure -a, but now i am getting the following error:

    dpkg: error: parsing file '/var/lib/dpkg/updates/0001' near line 0: newline in field name `#padding'"**
    

    I also tried cd /var/lib/dpkg/updates && rm -rf 0045 and sudo dpkg --configure -a , but that was no use.

    how do i fix this one?

    • muru
      muru over 9 years
      Just curious: if the file is named 0001, why would you do rm 0045? O.o
    • user332660
      user332660 over 9 years
      @muru if tried with 0001 then i got error like "rm: cannot remove `0001': Permission denied".
    • Kaz Wolfe
      Kaz Wolfe over 9 years
      I have edit permissions on this site.
    • Kaz Wolfe
      Kaz Wolfe over 9 years
      First off, don't delete files unless you are absolutely sure that you know what it does and how to recover if it's important.
    • user332660
      user332660 over 9 years
      ok i wont delete.then?
    • Lety
      Lety over 9 years
      If you want to delete file in /var/lib/dpkg/updates you need root grant, so run rm command with sudo. Be careful, especially if you use -rf. If you mess up, you may also remove all !!!
  • Erwin Smout
    Erwin Smout almost 5 years
    I suffered the exact same dpkg error and this does not help anything to solve it. -1.