6

I'm trying to upgrade some package in a VM, but I dpkg refuses to apply the upgrades due the following:

dpkg: error processing /var/cache/apt/archives/ifupdown_0.7.5ubuntu2.2_amd64.deb (--unpack):
 unable to make backup link of `./sbin/ifquery' before installing new version: No such file or directory
Preparing to replace unzip 6.0-8ubuntu1 (using .../unzip_6.0-8ubuntu2_amd64.deb) ...
Unpacking replacement unzip ...
dpkg: error processing /var/cache/apt/archives/unzip_6.0-8ubuntu2_amd64.deb (--unpack):
 unable to make backup link of `./usr/bin/unzip' before installing new version: No such file or directory
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

What it means? The permissions are fine and the file definitively exist:

ls -l /sbin/ifquery
-rwxr-xr-x 1 1500000 1500000 58496 dic 12  2012 /sbin/ifquery
Braiam
  • 35,991
  • Why the *.* in the path? ./usr/bin/unzip ; It would seem that you can't make a backup link of *$(pwd)/usr/bin/unzip* - is $(pwd) */.* ? I'm unfamiliar with dpkg but it seems strange that it would cd / before working. – mikeserv Mar 23 '14 at 07:19
  • It cd / ? Thats bloody crazy! – mikeserv Mar 23 '14 at 14:02
  • Ummm... I do everytime i upgrade chrome - its a deb that i use a pkgbuild to handle. Why? I adapted the pkgbuild but not to the point i had to get into that part... What'd i miss? – mikeserv Mar 23 '14 at 14:15

2 Answers2

2

ls -lsa /sbin/ifquery is not enough, check the file attribute with lsattr and you will very likely see something like:

$ lsattr /sbin/ifquery
----ia-------e- /sbin/ifquery

Only e is needed and wanted; remove the others. In my case: sudo chattr -ia /sbin/ifquery

$ sudo chattr -ia /sbin/ifquery 
$ sudo lsattr /sbin/ifquery
-------------e- /sbin/ifquery

In my case i and a respectively means that the file can't be modified and can only be appended. Now, try upgrading again.

1

This means that for some motive, you can't move the binary in the file system:

sudo mv /sbin/ifquery{,.bk}
[sudo] password for braiam:          
mv: cannot move ‘/sbin/ifquery’ to ‘/sbin/ifquery.bk’: Input/output error

You should check the filesystem for problems or ask your system administrator.

Braiam
  • 35,991
  • 3
    What if you are the system administrator? – cutrightjm Mar 23 '14 at 05:21
  • @ekaj then you have a little problem ;). I only asked what the message mean and why it happens, it didn't interested me how to solve the possible (too many) causes. Understand what the problem is is the first step to fix it, this answer explain why the error appears not how to fix it. – Braiam Mar 23 '14 at 05:24
  • @Braiam according to the data OP provides it doesnt appear anyone is trying to move /sbin/ifquery but rather ./sbin/ifquery – mikeserv Mar 23 '14 at 12:38