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?

  • 1
    Just curious: if the file is named 0001, why would you do rm 0045? O.o – muru Sep 9 '14 at 5:24
  • @Whaaaaaat how can you fix? – user332660 Sep 9 '14 at 5:27
  • @muru if tried with 0001 then i got error like "rm: cannot remove `0001': Permission denied". – user332660 Sep 9 '14 at 5:30
  • I have edit permissions on this site. – Kaz Wolfe Sep 9 '14 at 5:35
  • 1
    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. – Kaz Wolfe Sep 9 '14 at 5:53

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
| improve this answer | |

cleans the apt-get job

 sudo apt-get clean

updates package lists

sudo apt-get update

sudo apt-get install <whatever package>

should get you right

and as @Whaaaaat said you shouldn't delete anything unless you are absolutely sure what it is and what it does, especially if bash is telling you 'you need root permission to even do it'

| improve this answer | |
  • I suffered the exact same dpkg error and this does not help anything to solve it. -1. – Erwin Smout Jun 14 '19 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.