lhroot icon indicating copy to clipboard operation
lhroot copied to clipboard

Can't downlaod any file in Archlinux

Open arminhere opened this issue 3 years ago • 8 comments

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

arminhere avatar Jun 03 '22 18:06 arminhere

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

FerryAr avatar Jun 05 '22 15:06 FerryAr

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.

arminhere avatar Jun 05 '22 15:06 arminhere

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.

FerryAr avatar Jun 12 '22 13:06 FerryAr

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.

arminhere avatar Jun 12 '22 18:06 arminhere

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)

Efreak avatar Jul 23 '22 05:07 Efreak

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

jake5253 avatar Jul 25 '22 03:07 jake5253

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

khukuh123 avatar Jun 10 '23 15:06 khukuh123

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

sdykae avatar Sep 18 '23 07:09 sdykae