FerryAr / lhroot

Linux Chroot Installer & Bootscript Magisk Module.
GNU General Public License v3.0
190 stars 20 forks source link

Can't downlaod any file in Archlinux #5

Open arminhere opened 2 years ago

arminhere commented 2 years ago

Distro= ArchLinux ARM Android 12

basically cant download files or clone repos with wget and git with users other than root. downloading works fine with root user tho.

Error= could not resolve host: aur.archlinux.org

I do remember finding a fix for this a few years ago but can't find it today. i think it had something to do with /etc/resolve.conf

FerryAr commented 2 years ago

is the ping command work?

In case resolve.conf is empty or not found

execute this command echo "nameserver 1.1.1.1" >> /etc/resolv.conf

arminhere commented 2 years ago

ping command is not working either. resolve.conf already exists and cat /etc/resolve.conf returns nameserver 1.1.1.1 nameserver 1.0.0.1

I have also noticed that after exiting linux and killlinux command, resolve.conf gets reset every time.

FerryAr commented 2 years ago

ping command is not working either. resolve.conf already exists and cat /etc/resolve.conf returns nameserver 1.1.1.1 nameserver 1.0.0.1

I have also noticed that after exiting linux and killlinux command, resolve.conf gets reset every time.

Have you tried other distro? Arch Linux ARM is untested apparently, because the tarball size is so big.

arminhere commented 2 years ago

ping command is not working either. resolve.conf already exists and cat /etc/resolve.conf returns nameserver 1.1.1.1 nameserver 1.0.0.1 I have also noticed that after exiting linux and killlinux command, resolve.conf gets reset every time.

Have you tried other distro? Arch Linux ARM is untested apparently, because the tarball size is so big.

I have also tried Manjaro and it has the same issue.

Efreak commented 2 years ago

this or this might help? My issue personally was with apt, and telling it to run as root, not as the _apt user, however the posts have some information on how/why certain users are unable to access the internet in chroot on Android.

Edit: debugging apt was made harder by the fact that the debian image doesn't include ping or curl. Also it would be nice to have a way to include extra mounts without having to bind-mount it myself (I included my magisk modules, since they have several native binaries like nano)

jake5253 commented 2 years ago

to fix apt, at least in ubuntu and debian, try this inside your chroot: root@linux:-# echo "nameserver 1.1.1.1" | tee /etc/resolv.conf root@linux:-# addgroup --gid 3003 android_inet root@linux:-# usermod -g android_inet _apt

also worth noting that the ubuntu ports repository (for armhf) doesn't seem to be signed, or the wrong keys are in the tarball or something... quick fix for that. albeit VERY UNSAFE: root@linux:-# echo 'Acquire::AllowInsecureRepositories "true";' | tee /etc/apt/apt.conf.d/01allowinsecure i didn't investigate what was wrong, just bypassed security. this procedure is NOT recommended!

ping can be used through busybox (which seems to be built in on the tarball I received): root@linux:-# busybox ping -c4 google.com or you can install the applets: root@linux:-# busybox --install -s /sbin

khukuh123 commented 1 year ago

root@linux:-# addgroup --gid 3003 android_inet root@linux:-# usermod -g android_inet _apt

thank you this solution solve my problem for apt-get that return temporary failure resolving

sdykae commented 11 months ago

change your user id to 4000 or more, just works, login as root usermod -u 4000 username