termux / proot

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

Problems with apt with Ubuntu 16.04 #130

Closed ghost closed 2 years ago

ghost commented 3 years ago

Hey. can someone help me. i setup an Ubuntu 16.04 chroot environment and it seems there's a problem with apt but new versions works fine and idk why:

Screenshot_2020-11-04-15-32-34-71.jpg

I tested both Xenial and Trusty and gives me about apt can't open security status channel

Tested on my Android 9 Device

michalbednarski commented 3 years ago

Haven't tested myself but it seems that you should be able to workaround this by LD_PRELOAD'ing library with following code

int is_selinux_enabled(void) { return 0; }
gcc sefake.c -o sefake.so -shared
LD_PRELOAD=/root/sefake.so apt update
ghost commented 3 years ago

@michalbednarski it seems there's an compilation error

sefake.c:1:66: error: stray ‘\240’ in program
    1 | bled(void) { return��0; }
      |                                      ^

sefake.c:1:67: error: stray ‘\342’ in program
    1 | bled(void) { return ���0; }
      |                                       ^

sefake.c:1:68: error: stray ‘\200’ in program
    1 | bled(void) { return ���0; }
      |                                        ^

sefake.c:1:69: error: stray ‘\213’ in program
    1 | bled(void) { return ��0; }
      |                                         ^

sefake.c:1:71: error: stray ‘\342’ in program
    1 | void) { return 0���; }
      |                                ^

sefake.c:1:72: error: stray ‘\200’ in program
    1 | oid) { return 0���; }
      |                                ^

sefake.c:1:73: error: stray ‘\213’ in program
    1 | id) { return 0��; }
      |                                ^

Am i missing something?

michalbednarski commented 3 years ago

Looks like some (nonprintable?) characters were added on copy-paste, try retyping sefake.c into new file

ghost commented 3 years ago

@michalbednarski It does work but it seems there's an error:

(Xenial):

dpkg (subprocess): cannot set security execution context for maintainer script: Permission denied

But Ubuntu Trusty works without errors. but it gives me symlink size changed then closed with errors when upgrading packages

(Trusty):

Screenshot_2020-11-06-16-58-05-84.jpg

But This error occurs on new versions like Debian 10 when upgrading packages and didn't crash at all

ZhymabekRoman commented 3 years ago

Screenshot_2020-11-06-16-58-05-84.jpg

Try add -L flag when starting proot

-L Correct the size returned from lstat for symbolic links.

ghost commented 3 years ago

Does that work with arm64?

I used pelya's libandroid-shmem-disableselinux.so from debian Noroot and it installs fine with -L option

ghost commented 3 years ago

Reopening it, seems i got failure about symlinks, even with -L when proot'ing into xenial rootfs

Screenshot_2021-03-09-16-47-01-84.jpg

Although i haven't run Ubuntu 16.04 insid e proot for a while now, although I don't exactly remember how it got worked again


However in 32-bit, Ubuntu 16.04 apt upgrade works fine with -L flag but not in arm64