I'm not sure if this is the exact same issue, but I had a similar error message with my most recent apt-get upgrade. As can be seen, the issue here was that dpkg tried to make a backup of a directory to a location that was not empty:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
linux-firmware-image-sun7i linux-headers-sun7i linux-image-sun7i linux-jessie-root-cubietruck
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.4 MB of archives.
After this operation, 12.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.armbian.com/ jessie/main linux-firmware-image-sun7i armhf 5.15 [285 kB]
Get:2 http://apt.armbian.com/ jessie/main linux-headers-sun7i armhf 5.15 [5,786 kB]
Get:3 http://apt.armbian.com/ jessie/main linux-image-sun7i armhf 5.15 [14.0 MB]
Get:4 http://apt.armbian.com/ jessie/main linux-jessie-root-cubietruck armhf 5.15 [372 kB]
Fetched 20.4 MB in 11s (1,778 kB/s)
(Reading database ... 61165 files and directories currently installed.)
Preparing to unpack .../linux-firmware-image-sun7i_5.15_armhf.deb ...
Unpacking linux-firmware-image-sun7i (5.15) over (5.11) ...
Preparing to unpack .../linux-headers-sun7i_5.15_armhf.deb ...
Unpacking linux-headers-sun7i (5.15) over (5.11) ...
Preparing to unpack .../linux-image-sun7i_5.15_armhf.deb ...
Unpacking linux-image-sun7i (5.15) over (5.11) ...
Preparing to unpack .../linux-jessie-root-cubietruck_5.15_armhf.deb ...
mv: cannot move ‘/boot/bin’ to ‘/boot/bin.old/bin’: Directory not empty
Unpacking linux-jessie-root-cubietruck (5.15) over (5.11) ...
dpkg: error processing archive /var/cache/apt/archives/linux-jessie-root-cubietruck_5.15_armhf.deb (--unpack):
unable to make backup link of `./boot/bin/bananapi.bin' before installing new version: Operation not permitted
Processing triggers for systemd (215-17+deb8u4) ...
Errors were encountered while processing:
/var/cache/apt/archives/linux-jessie-root-cubietruck_5.15_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A close look at /boot/bin.old revealed that inside /boot/bin.old was another bin folder:
root@xxxxxx:/boot/bin.old# ls -la
total 984
drwxr-xr-x 3 root root 4096 May 27 18:12 .
drwxr-xr-x 5 root root 16384 Jul 1 09:10 ..
-rwxr-xr-x 1 root root 45936 Feb 11 23:48 aw-som-a20.bin
-rwxr-xr-x 1 root root 50560 Feb 11 23:48 bananapi.bin
-rwxr-xr-x 1 root root 50624 Feb 11 23:48 bananapilcd7.bin
-rwxr-xr-x 1 root root 50656 Feb 11 23:48 bananapipro.bin
-rwxr-xr-x 1 root root 50500 Feb 11 23:48 bananapiprolcd7.bin
drwxr-xr-x 2 root root 4096 May 6 10:37 bin
-rwxr-xr-x 1 root root 46308 Feb 11 23:48 cubieboard2.bin
-rwxr-xr-x 1 root root 46248 Feb 11 23:48 cubieboard2dual.bin
-rwxr-xr-x 1 root root 43716 Feb 11 23:48 cubieboard.bin
-rwxr-xr-x 1 root root 46404 Feb 11 23:48 cubietruck.bin
-rwxr-xr-x 1 root root 51012 Feb 11 23:48 lamobo-r1.bin
-rwxr-xr-x 1 root root 53480 Feb 11 23:48 lime2.bin
-rwxr-xr-x 1 root root 43508 Feb 11 23:48 lime-a10.bin
-rwxr-xr-x 1 root root 52616 Feb 11 23:48 lime.bin
-rwxr-xr-x 1 root root 52252 Feb 11 23:48 micro.bin
-rwxr-xr-x 1 root root 29804 Feb 11 23:48 olinux-som-a13.bin
-rwxr-xr-x 1 root root 35888 Feb 11 23:48 orangepi2.bin
-rwxr-xr-x 1 root root 50972 Feb 11 23:48 orangepi.bin
-rwxr-xr-x 1 root root 35996 Feb 11 23:48 orangepione.bin
-rwxr-xr-x 1 root root 36000 Feb 11 23:48 orangepipc.bin
-rwxr-xr-x 1 root root 36768 Feb 11 23:48 orangepiplus.bin
-rwxr-xr-x 1 root root 49300 Feb 11 23:48 pcduino3nano.bin
-rwxr-xr-x 1 root root 4229 Jan 2 13:53 upgrade.log
I suspect that this issue may be caused by multiple updates due to some error in the update scripts. The first time, the old /boot/bin directory is renamed to /boot/bin.old. The second time, the directory /boot/bin.old already exists and the /boot/bin directory is moved into that directory. The third time: we already have /boot/bin.old/bin and a move of /boot/bin to /boot/bin.old/bin causes this failure.
I've solved this by moving bin.old and the bin folder inside it to another name and running apt-get upgrade again:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
linux-jessie-root-cubietruck
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/372 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 61134 files and directories currently installed.)
Preparing to unpack .../linux-jessie-root-cubietruck_5.15_armhf.deb ...
Unpacking linux-jessie-root-cubietruck (5.15) over (5.11) ...
Processing triggers for systemd (215-17+deb8u4) ...
Setting up linux-firmware-image-sun7i (5.15) ...
Setting up linux-headers-sun7i (5.15) ...
Compiling headers - please wait ...
Setting up linux-image-sun7i (5.15) ...
Image Name: Linux kernel
Created: Fri Jul 1 09:30:02 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5606240 Bytes = 5474.84 kB = 5.35 MB
Load Address: 40008000
Entry Point: 40008000
Setting up linux-jessie-root-cubietruck (5.15) ...
As can be seen, the uImage is created as well. I still have to reboot the system, but I guess that it will work normally.
Please confirm if other have seen this as well, I can create a small bug report if this is indeed a mistake in the upgrade scripts...
Edit: reboot works normally, boot from nand...