Just updated my installed packages and vim failed to update with the error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
vim vim-runtime
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 4422 kB of archives.
After this operation, 16.4 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://termux.net stable/main all vim-runtime all 8.0.0092 [3715 kB]
Get:2 http://termux.net stable/main aarch64 vim aarch64 8.0.0092 [707 kB]
Fetched 4422 kB in 1s (3571 kB/s)
(Reading database ... 2024 files and directories currently installed.)
Preparing to unpack .../vim-runtime_8.0.0092_all.deb ...
Unpacking vim-runtime (8.0.0092) over (8.0.0055) ...
Preparing to unpack .../vim_8.0.0092_aarch64.deb ...
Unpacking vim (8.0.0092) over (8.0.0055) ...
dpkg: error processing archive /data/data/com.termux/files/usr/var/cache/apt/archives/vim_8.0.0092_aarch64.deb (--unpack):
symbolic link '/data/data/com.termux/files/usr/share/man/man1/view.1' size has changed from 18 to 5
Processing triggers for man (1.13.4-3) ...
E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (1)
I've seen this with other packages before, I usually get round the problem with removing the package and reinstalling. Is there a way to get this to update cleanly?
Hm, I never encountered this issue myself, but I remember other being hit by it.
Related link: https://bugs.launchpad.net/ubuntu/+source/ubuntu-docs/+bug/1364642
A temporary workaround is either to do the remove&reinstall as you do, or (according to the link) remove the offending symlink.
@skymoo Which device and Android version is this? Do you have filesystem encryption enabled?
Reference: https://github.com/corbinlc/GNURootDebian/issues/103
Found out something: the issue is that dpkg assumes that a file's st_size matches the length of the string returned by readlink(). [..]
On this Android N device, this isn't the case: [..]
Might have to do with file-based encryption being enabled on this Android N device - however, regular files (non-symlinks) don't exhibit this behavior.
This will perhaps be fixed in dpkg 1.18.6 shortly:
For dpkg 1.18.16 (which should happen in a couple of days at most) I'll probably relax the check and allow size differences that are shorter than expected, but still emit a warning. Hope this makes the current situation for now more bearable.
I'm using a Google Pixel, so it's using FBE.
+1, and I added an issue here:
https://github.com/termux/termux-app/issues/204
... which might have been the wrong place. If so, please feel free to remove it.
Also on a Pixel.
I too am having this issue on my Google Pixel. I didn't have this problem on my previous phone, a Nexus 5.
@skymoo @dbdahl @mlanner @h6y3: I've updated dpkg to version 1.18.15 with a local patch to work around the issue. Can you try it out by installing dpkg manually with:
wget http://termux.net/dists/stable/main/binary-aarch64/dpkg_1.18.15_aarch64.deb
dpkg -i dpkg_1.18.15_aarch64.deb
and then see if
apt update && apt upgrade
now works?
@fornwall Confirmed it works for me.
@mlanner Great! I've updated the bootstrap packages that are initially installed to this dpkg version, so new installs should not be hit by this issue.
For those already affected: Either do the manual dpkg update above, or do a complete re-install of the app.
@fornwall Works for me. Thanks for a great app!
Thanks for the fix, awesome app
Thanks, I'm not seeing this issue presently as I worked around it when I last saw it. However I did do a complete reinstall of the app a couple of hours ago as I accidentally removed apt, not sure how I managed that. As you can imagine that didn't end well, hence reinstalling the app. :-)
If I see this problem again I'll update this ticket.
FYI, I just got hit with this issue when apt tried to update busybox. Manually installing the new dpkg (conveniently already in apt's package cache) solved the issue.
I have a dpkg: warning: symbolic link
and when I tried ls -la /data/data/com.termux/files/usr/lib/libintl.so
I got No such file or directory
My dpkg version Debian 'dpkg' package management program version 1.19.7 (aarch64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
My mobile phone is Oppo f11
Most helpful comment
@fornwall Confirmed it works for me.