termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
742 stars 162 forks source link

[Bug]: usrmerge package has error after update in Debian Unstable #244

Closed sam-gq closed 1 year ago

sam-gq commented 1 year ago

Problem description

I am using Debian Unstable for a long time on my devices which I used for leaning how to use debian package.

I have a new update about “init-system-helpers” package with version 1.65.2 from 1.64. Which it has a new dependency package called “usrmerge”.

init-system-helpers is the essential package in which package has essential tag cannot be removed.

Now I accept the update after backup the entire distro.

Here this is happened.

~ $ proot-distro login debian
root@localhost:~# apt update && apt upgrade --no-install-recommends
Hit:1 http://deb.debian.org/debian unstable InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  libfile-find-rule-perl libgdbm-compat4 libgdbm6 libnumber-compare-perl
  libperl5.34 libtext-glob-perl perl perl-modules-5.34 usrmerge
The following packages will be upgraded:
  init-system-helpers
1 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 7411 kB of archives.
After this operation, 50.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian unstable/main arm64 perl-modules-5.34 all 5.34.0-5 [2850 kB]
Get:2 http://deb.debian.org/debian unstable/main arm64 libgdbm6 arm64 1.23-2 [81.6 kB]
Get:3 http://deb.debian.org/debian unstable/main arm64 libgdbm-compat4 arm64 1.23-2 [58.5 kB]
Get:4 http://deb.debian.org/debian unstable/main arm64 libperl5.34 arm64 5.34.0-5 [4016 kB]
Get:5 http://deb.debian.org/debian unstable/main arm64 perl arm64 5.34.0-5 [298 kB]
Get:6 http://deb.debian.org/debian unstable/main arm64 libnumber-compare-perl all 0.03-2 [7448 B]
Get:7 http://deb.debian.org/debian unstable/main arm64 libtext-glob-perl all 0.11-2 [8992 B]
Get:8 http://deb.debian.org/debian unstable/main arm64 libfile-find-rule-perl all 0.34-2 [28.4 kB]
Get:9 http://deb.debian.org/debian unstable/main arm64 usrmerge all 31 [13.0 kB]
Get:10 http://deb.debian.org/debian unstable/main arm64 init-system-helpers all 1.65.2 [49.8 kB]
Fetched 7411 kB in 8s (954 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package perl-modules-5.34.
(Reading database ... 6567 files and directories currently installed.)
Preparing to unpack .../0-perl-modules-5.34_5.34.0-5_all.deb ...
Unpacking perl-modules-5.34 (5.34.0-5) ...
Selecting previously unselected package libgdbm6:arm64.
Preparing to unpack .../1-libgdbm6_1.23-2_arm64.deb ...
Unpacking libgdbm6:arm64 (1.23-2) ...
Selecting previously unselected package libgdbm-compat4:arm64.
Preparing to unpack .../2-libgdbm-compat4_1.23-2_arm64.deb ...
Unpacking libgdbm-compat4:arm64 (1.23-2) ...
Selecting previously unselected package libperl5.34:arm64.
Preparing to unpack .../3-libperl5.34_5.34.0-5_arm64.deb ...
Unpacking libperl5.34:arm64 (5.34.0-5) ...
Selecting previously unselected package perl.
Preparing to unpack .../4-perl_5.34.0-5_arm64.deb ...
Unpacking perl (5.34.0-5) ...
Selecting previously unselected package libnumber-compare-perl.
Preparing to unpack .../5-libnumber-compare-perl_0.03-2_all.deb ...
Unpacking libnumber-compare-perl (0.03-2) ...
Setting up libnumber-compare-perl (0.03-2) ...
Selecting previously unselected package libtext-glob-perl.
(Reading database ... 8563 files and directories currently installed.)
Preparing to unpack .../libtext-glob-perl_0.11-2_all.deb ...
Unpacking libtext-glob-perl (0.11-2) ...
Setting up libtext-glob-perl (0.11-2) ...
Selecting previously unselected package libfile-find-rule-perl.
(Reading database ... 8570 files and directories currently installed.)
Preparing to unpack .../libfile-find-rule-perl_0.34-2_all.deb ...
Unpacking libfile-find-rule-perl (0.34-2) ...
Setting up perl-modules-5.34 (5.34.0-5) ...
Setting up libgdbm6:arm64 (1.23-2) ...
Setting up libgdbm-compat4:arm64 (1.23-2) ...
Setting up libperl5.34:arm64 (5.34.0-5) ...
Setting up perl (5.34.0-5) ...
Setting up libfile-find-rule-perl (0.34-2) ...
Selecting previously unselected package usrmerge.
(Reading database ... 8585 files and directories currently installed.)
Preparing to unpack .../archives/usrmerge_31_all.deb ...
Unpacking usrmerge (31) ...
Setting up usrmerge (31) ...
ionice: ioprio_set failed: Operation not permitted
chrt: failed to set pid 26298's policy: Operation not permitted
cp: cannot open '/bin/.l2s.gunzip.dpkg-new0001' for reading: Too many levels of symbolic links

FATAL ERROR:
cp --no-dereference --preserve=all --reflink=auto --sparse=always /bin/.l2s.gunzip.dpkg-new0001 /usr/bin/.l2s.gunzip.dpkg-new0001: rc=1

You can try correcting the errors reported and running again
/usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
Do not install or update other Debian packages until the program
has been run successfully.

E: usrmerge failed.
dpkg: error processing package usrmerge (--configure):
 installed usrmerge package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 usrmerge
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@localhost:~#

Please find out how to fix this error before Debian Bookworm came out in, which is being accepted by the maintainers.

As of now I held the init-system-helpers from updating to latest version, unless the dependency “usrmerge” will be removed.

Please look at the Debian Package Tracker. https://tracker.debian.org/

Or you can redirect that said package. https://tracker.debian.org/pkg/init-system-helpers https://tracker.debian.org/pkg/usrmerge

What steps will reproduce the bug?

I'm on Debian Unstable. Simply apt upgrade the init-system-helpers with usrmerge.

What is the expected behavior?

Expecting to be good after updating init-system-helpers with a new dependency “usrmerge” that is not in the use case but required by debian if I forgot to update the package.

michalbednarski commented 1 year ago

This is limitation of proot default link2symlink handling, you can switch that but it'll require wiping your current installation:

  1. Wipe current install (proot-distro reset debian)
  2. After first login run following command in guest: mkdir /.l2s
  3. Exit from that session and start proot-distro again, after restarting it is okay to start using apt
sam-gq commented 1 year ago

Good point, I think it is gonna work, not sure. So I tried to create a new clean install instead, and I followed your instruction.

  1. After first login run following command in guest: mkdir /.l2s
  2. Exit from that session and start proot-distro again, after restarting it is okay to start using apt.

In just 1st or 2nd attempts of upgrading apt upgrade usrmerge, the usrmerge works in 2nd attempt (don't remember the 1st attempt how to do if I just restart proot when outputs an error of apt upgrade).

In my inspection, I tried to execute convert-usrmerge again and it works. And I look at the root directory, there has no /bin, /sbin, and /lib folder anymore. Just an invalid file but it has a symbolic link as well!

Screenshot_20221102_082748

sam-gq commented 1 year ago

Anyway, I have a request. Do you have a time to make /.l2s directory of the debian rootfs, and then upload it to proot-distro? Seems to be great.

@michalbednarski is that ok? Or anyone..

michalbednarski commented 1 year ago

I'd have to redirect that topic (creation of /.l2s in guest) back to proot-distro (@sylirre)

As far as I can remember there were some problems with that but cannot remember what

sylirre commented 1 year ago

Yes, there were problems related to /.l2s directory. For example on Alpine Linux it was not possible to install gcc package. However it seems doesn't happen now or there different steps needed to trigger.

sam-gq commented 1 year ago

I have recieved a new update for proot-distro 3.3.0, added /.l2s directory when creating a new rootfs on installing a distribution. 2bcc4f1 by @sylirre.

Works on debian on creating rootfs directory, by installing usrmerge in unstable repo, in 1st attempt.

Fixed in 3.3.0