Upgrading with no disk space breaks dpkg irrecoverably

Bug #215305 reported by Tom Adams
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dpkg (Baltix)
New
Undecided
Unassigned
dpkg (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: dpkg

I ran "sudo aptitude safe-upgrade" yesterday and I lacked sufficient space on / for the upgrades, so dpkg failed. I'm afraid I didn't record the output.

After freeing some space I run "sudo aptitude safe-upgrade" and it gives me the following output:
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

Running "sudo dpkg --configure -a":
dpkg: parse error, in file `/var/lib/dpkg/updates/0168' near line 1:
 newline in field name `#padding'

dpkg seems permanently broken. I can't install new packages, or upgrades.

Revision history for this message
Danny Masri (d-masri) wrote :

I get a similar error and need help resolving

When i try to add/remove programs i get the following error:
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
E: _cache->open() failed, please report

So i've tried all the following comands:

sudo apt-get -f install
sudo apt-get clean all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean all
sudo apt-get autoremove

but each time i get asked to run sudo dpkg --configure -a and when i do i get
dpkg: parse error, in file `/var/lib/dpkg/updates/0214' near line 1:
 newline in field name `#padding'

How do i solve this error?

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

Danny Masri wrote:
> dpkg: parse error, in file `/var/lib/dpkg/updates/0214' near line 1:
> newline in field name `#padding'
> How do i solve this error?

Such dpkg bug can be easy solved - open the file /var/lib/dpkg/updates/0214 and remove all lines with contents '#padding' (or simply remove file /var/lib/dpkg/updates/0214 )

This bug appears because you don't have enough free disk space in / or /var partition, AFAIK you should have at least 100 MB free disk space in / (and in /var, if you have separate /var) partition before runing 'dpkg --configure -a' . Simply run command 'df -h' in terminal and you will see how much free space you have in each partition :)

If you have not enough free space you can remove old .deb files from /var/cache/apt/archives/ folder

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

I think this has been indirectly fixed when we added proper syncing of the updates directory. dpkg deals correctly with no disk space. An update file only appears after having been written to in a temporary file and renamed. Thus you should never see the #padding in an update file.

Thus marking as fix released. If it persists, it means a filesystem bug more than a dpkg bug.

Changed in dpkg (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.