termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.01k stars 2.99k forks source link

Apt update fails - Clearsigned file isn't valid, got 'NOSPLIT' #8138

Closed unman closed 1 year ago

unman commented 2 years ago

I have exactly the same issue as termux/termux-app#78:

Err:1 http://termux.net stable InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 965 B in 4s (196 B/s)
Reading package lists... Done
W: Failed to fetch http://termux.net/dists/stable/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.

This is a clean install from F-Droid on a new lineage-os install.

I have read the note in Package Management, disabled the games and science repos, and tried all available mirrors for the main repository. All return the same error message.

At a loss.

Grimler91 commented 2 years ago

What's your output of termux-info? Android 5 and 6 is technically not supported anymore, and we (as in the active maintainers on github) do not control termux.net, so cannot do anything on the server side.

Can you visit the url in a browser?

disabled the games and science repos

You can change so that it uses https://github.com/termux/game-packages-21-bin and https://github.com/termux/science-packages-21-bin instead, see READMEs in those repos.

and tried all available mirrors for the main repository

Which mirrors? There are basically no mirrors for the android 5 & 6 repositories (exception being some of the chinese mirrors). If you have switched to an android >=7 mirror on an android 5 & 6 device then that will cause various issues

burnbasket commented 2 years ago

My problem is identical. It's been this way for a couple of months on LineageOS 18.1. I have this problem again on a HavocOS 4.6 which is a fresh install.

You asked for the termux-info output, here it is (termux-info>ti.txt 2>&1) on HavocOS 4.6:

find: ‘/data/data/com.termux/files/usr/etc/apt/sources.list.d’: No such file or directory
Application version:
0.117
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://grimler.se/termux-packages-24 stable main
Updatable packages:
All packages up to date
Android version:
11
Kernel build information:
Linux localhost 3.10.108-g747bc0e3 #1 SMP PREEMPT Tue Jul 27 03:55:10 PDT 2021 armv7l Android
Device manufacturer:
samsung
Device model:
SM-N910F

This is an F-Droid install and so is the one on LineageOS, but as far as I recall the "pkg update" behaviour is the same on the Google Play installs. This is after removing the games and science repos.

I have been on the brink of giving up fpr a couple of months, but the terminal is so much better than all alternatives I know, it's a hard habit to break ;-)

Grimler91 commented 2 years ago

Please share the full message that you get. You seem to be using the latest termux version, and have all packages up to date, so error message can't be identical to the one in the first post.

burnbasket commented 2 years ago

Here is the output of (pkg update >pu.txt 2&1):

Checking availability of current mirror: ok

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 https://grimler.se/termux-packages-24 stable InRelease [16.8 kB]
Err:1 https://grimler.se/termux-packages-24 stable InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists...
E: Could not read from /data/data/com.termux/files/usr/var/lib/apt/lists/partial/grimler.se_termux-packages-24_dists_stable_InRelease - getline (22: Invalid argument)
E: Failed to fetch https://grimler.se/termux-packages-24/dists/stable/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'https://grimler.se/termux-packages-24 stable InRelease' is not signed.
Grimler91 commented 2 years ago

Can you access https://grimler.se/termux-packages-24 in a browser? Seems like there might be a problem with your internet connection.

Try another mirror (change with termux-change-repo) if issue persists with that mirror

burnbasket commented 2 years ago

Thanks for the super quick response. I will try this address in the phone's firefox browser.

burnbasket commented 2 years ago

Yes, https://grimler.se/termux-packages-24 does work in firefox on the phone.

burnbasket commented 2 years ago

Same result on the "default" repo:

Checking availability of current mirror: ok

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 https://packages.termux.org/apt/termux-main stable InRelease [14.0 kB]
Err:1 https://packages.termux.org/apt/termux-main stable InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists...
E: Could not read from /data/data/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease - getline (22: Invalid argument)
E: Failed to fetch https://packages.termux.org/apt/termux-main/dists/stable/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'https://packages.termux.org/apt/termux-main stable InRelease' is not signed.
Grimler91 commented 2 years ago

Can you wget https://packages.termux.org/apt/termux-main/dists/stable/InRelease or curl -LO https://packages.termux.org/apt/termux-main/dists/stable/InRelease?

It works fine on my arm LOS 18.1 installation

burnbasket commented 2 years ago

Yes, the curl command works (wget isn't installed):


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Origin: termux-main stable
Label: termux-main stable
Suite: stable
Codename: stable
Date: Sat, 25 Dec 2021 11:39:21 UTC
Architectures: aarch64 arm i686 x86_64
Components: main
Description: Generated by aptly
MD5Sum:
 e56dd3f07cff56f10a7ddbf0fad12ad5 41290807 Contents-aarch64
 b76bce82b466d4c3b3df0065ee0f9b76  2022335 Contents-aarch64.gz
 ...
 2a2c2cf3d87f156c4b8e3b8d47a264e9   378657 main/binary-x86_64/Packages.gz
 f146d1c8ab34831494818e11ea2bab13      106 main/binary-x86_64/Release
SHA1:
 f01050530b200a06c6418efc490a3e617691f6a3 41290807 Contents-aarch64
 db16710816d32b9329b037ee5fa3ca574a26b126  2022335 Contents-aarch64.gz
 ...
 bc31926fd1177ed56e087adaf03846e0026421cd      106 main/binary-x86_64/Release
SHA256:
 dc185cfbc09fa3d54837cf53b9086dca8a7934c456dee8e79ffb56e1ccadb548 41290807 Contents-aarch64
 3e056f646395c382a4c1c724b9d20f4d8ccfb92741b38ed5287c613c89dd5285  2022335 Contents-aarch64.gz
 ...
 b37a641b6fa59068887468b13042281628aca8a82e0ae47ad361859933233221      106 main/binary-x86_64/Release
SHA512:
 4585235e927a0739c6f73638dc1bc5c4a45dda4ab17a75503e33f7c81edfe4c1f5620200c2e2b324f3641294e574ab942333dd4bd94a34f2bab0e20357687209 41290807 Contents-aarch64
 7bde3cce617c6ff0d1f21097088b1d74c7fece0def2edf05771e6d16a216f7fcfa0e20f22cb9f7df1608e3a4a875951e1fefe409af53b0ea73f69b5554408c4c  2022335 Contents-aarch64.gz

...

778d0bceef951e49ea71bbef794c59b299ccb72e3c502d96ef34caaa3ab724dbb2fa45fd6c9fc1109bb1dbcc963e772c8ee68ca9c0298f1a02dd8c1939ec24ba      106 main/binary-x86_64/Release
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEzHLPi6fb+gGCh30EWol9luV88gwFAmHHAuoACgkQWol9luV8
8gzU6A/+POnf5FZnmP633XFQjoRT5+jGzXFb/g3iVk4Xa3x+xx8O1xsxahLdjL4f
xsOxkbj3KwQ0BCQ4EvUaXwiH+OGTwaSSeteM76+otxjWm+Y0wpUK2VksWF6Wy90S
6Fs6wz6ZGKoKoA+wqGXlogYGkwoKJQ+DCAvYKVDZTmE+l9JUgmd8Z/l3uXfkavqt
wOD3cxZm/bYvIZDhhZDVtq4UwflCeyJmaSGonnFSwvDiN3XwMhxBaFbB8SSVMTsO
OZ8LEye7xjBKnlBy/0KpNFnKPGn2oCRJ6gWZFejsJHe0t+A+xYHh0yK7NUE44Yoe
jqmpKaiDUmmoht4Ah0Un9pH6/W3+0ch2L5bTGR8aEgSJLRZcqlZWItjuQIbQkHsL
kldtTeYV3PtPea6OGXyGVz4QpA8hgfSB3Tiga2N/fB/sluJj0zUUk6rt3s1SQhYm
K9kwLDUbE5GCa449QtxUQ5nRbAEwi/PiurFdDv+4EZf2xdOcmdD+xVrPI1ngWYTl
xECuMikXpH2srXH/hOdiA21FZ+Tqw0PBKup6nEG8nN5vCSfyIG8JeAfzn7ImliuM
JJHyvzWMsAWDejVerPO+Hwl3j/5qj6aRuQD7N4MQ/QglKzO8gKRgPM20XbMCaPJ/
L5e3LwAP35QNocD2t5qgS4eRXoSiWpL+xBwaJxaUEIbKNq8b4ac=
=hAet
-----END PGP SIGNATURE-----

I replaced some output lines with ellipses in the checksums manually.

burnbasket commented 2 years ago

Maybe I need to install ca-certs manually? It IS a fresh install from F-Droid, however.

Grimler91 commented 2 years ago

Seems like apt is weird on this device, or maybe it is an issue with havocOS. Doesn't seem to affect many devices (since this is the only issue where error is reported)

burnbasket commented 2 years ago

I think you're right.

This issue is present on both HavocOS 4.6 and LineageOS 18.1 on two Note 4 devices. These devices are ancient and apparently becoming pretty rare as well, so I guess I'm out of luck.

I can confirm the problem doesn't affect a Samsung Galaxy S4 with LineageOS 18.1 I checked this with.

If anyone does happen to find a solution or workaround I'd be much obliged if you could share it.

Thanks @Grimler91 for taking the time to look into this.

unman commented 2 years ago

On Thu, Dec 30, 2021 at 07:26:07AM -0800, burnbasket wrote:

I think you're right.

This issue is present on both HavocOS 4.6 and LineageOS 18.1 on two Note 4 devices. These devices are ancient and apparently becoming pretty rare as well, so I guess I'm out of luck.

I can confirm the problem doesn't affect a Samsung Galaxy S4 with LineageOS 18.1 I checked this with.

If anyone does happen to find a solution or workaround I'd be much obliged if you could share it.

Thanks @Grimler91 for taking the time to look into this.

Interesting, thanks for this. I'm not clear on how apt can be "odd" on a specific device. @Grimler91 - any chance you could point toward some possible troubleshooting areas? I'm happy to poke around for a while in the hope of fixing this.

As a point of comparison, other terminals and update mechanisms dont seem to have any problems on a Note4 with the same LineageOS.

agnostic-apollo commented 2 years ago

Do you guys have an VPN/proxy/custom dns set up on your phone or router? Grimler repo is working fine on lineageOS 18.1 on xiaomi poco f2 pro.

According to this, wget and browser works, but apt fails.

unman commented 2 years ago

Not me, and I have tried on different networks with same result. I only see this issue with termux apt - other apps are fine and termux doesnt have wget installed.

On Thu, Dec 30, 2021 at 08:08:42AM -0800, agnostic-apollo wrote:

Do you guys have an VPN/proxy/custom dns set up on your phone or router? Grimler repo is working fine on lineageOS 18.1 on xiaomi poco f2 pro.

According to this, wget and browser works, but apt fails.

-- Reply to this email directly or view it on GitHub: https://github.com/termux/termux-packages/issues/8138#issuecomment-1003091443 You are receiving this because you authored the thread.

Message ID: @.***>

burnbasket commented 2 years ago

Same as @unman for me. No exotic DHCP setup, no VPN, no proxy.

My termux also doesn't have wget installed, but everything works fine with curl (see above in this thread).

burnbasket commented 2 years ago

I do run my own DNS server, but the requests for the domains in question are only passthrough. Besides, the same issue occurs on LTE connections with WLAN disabled.

ghost commented 2 years ago

termux.net (legacy repo):

InRelease file is valid, properly signed and was not modified since Tue 24 Dec 2019 12:47:36 AM EET.

~ $ curl -LO https://termux.net/dists/stable/InRelease
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1720  100  1720    0     0  34583      0 --:--:-- --:--:-- --:--:-- 35102
~ $ gpg --verify InRelease
gpg: Signature made Tue 24 Dec 2019 12:47:36 AM EET
gpg:                using RSA key 2218893D3F679BEFC421FD976700B77E6D8D0AE7
gpg: Good signature from "Fredrik Fornwall <fredrik@fornwall.net>" [ultimate]

packages.termux.org:

~ $ curl -LO https://packages.termux.org/apt/termux-main/dists/stable/InRelease
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14016  100 14016    0     0  20319      0 --:--:-- --:--:-- --:--:-- 20313
~ $ gpg --verify InRelease
gpg: Signature made Thu 30 Dec 2021 12:29:32 PM EET
gpg:                using RSA key CC72CF8BA7DBFA0182877D045A897D96E57CF20C
gpg: Good signature from "Termux Releases (Termux automatic builds) <contact@termux.com>" [full]

- same valid & properly signed.


Errors are on user side and can be specific to:

Try editing $PREFIX/etc/sources.list and change https to http in URL or vice-versa if used http before.

burnbasket commented 2 years ago

@xeffyr: Thanks for the suggestion.

I changed the protocol from https to http in $PREFIX/etc/apt/sources.list ($PREFIX is /data/data/com.termux/files/usr on my device). It now reads: deb http://packages.termux.com/apt/termux-main/ stable main This is the only line the file contains.

pkg update gives the same result.

curl -L0 http://packages.termux.org/apt/termux-main/dists/stable/InRelease -o InRelease works. I can't verify the signature on the device because gpg isn't installed. If I download the InRelease file to my workstation, this is what I get:

username@machinename(18:41:41):~$ gpg --verify /media/.../InRelease 
gpg: Signature made Thu 30 Dec 2021 11:29:32 CET
gpg:                using RSA key CC72CF8BA7DBFA0182877D045A897D96E57CF20C
gpg: Can't check signature: No public key
ghost commented 2 years ago

this is what I get

gpg: Can't check signature: No public key

You don't have key in gpg keyring. That's because verification doesn't work.

burnbasket commented 2 years ago

@xeffyr: Stupid me ;-)

I imported the key from https://github.com/termux/termux-packages/blob/master/packages/termux-keyring/termux-autobuilds.gpg

Now this is the verification result, again on my workstation:

username@machinename(19:14:20):~$ gpg --verify /media/.../InRelease 
gpg: Signature made Thu 30 Dec 2021 11:29:32 CET
gpg:                using RSA key CC72CF8BA7DBFA0182877D045A897D96E57CF20C
gpg: Good signature from "Termux Releases (Termux automatic builds) <contact@termux.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: CC72 CF8B A7DB FA01 8287  7D04 5A89 7D96 E57C F20C

This looks to be fine.

Grimler91 commented 2 years ago

@burnbasket which note device(s) is it that you have, the one with exynos5433 or the one with snapdragon 805?

burnbasket commented 2 years ago

trlte:/ $ grep -i "hardware" /proc/cpuinfo
Hardware : Qualcomm APQ8084

I believe this is the Snapdragon 805. Same CPU on both devices.

Grimler91 commented 2 years ago

@unman can you share your output of termux-info? Do you also have a note device, since you mentioned note?

I'm not clear on how apt can be "odd" on a specific device.

As @xeffyr said, apt uses ROM specific system libraries. Some issues are also kernel or CPU specific, see for example this torsocks issue (failure for old kernels with missing syscalls) and this openssl issue (probing CPU for capabilities).

any chance you could point toward some possible troubleshooting areas? I'm happy to poke around for a while in the hope of fixing this.

A good start would be to have a look in apt's source code what the error message actually means, Clearsigned file isn't valid, got 'NOSPLIT' is kinda hard to understand (what is NOSPLIT?). Seems like error happens when it tries to rename/mv some file, so maybe some folder has wrong permissions, or simply some folder doesn't exist? scratch that it renames the file on error, the error doesn't come from the renaming procedure.

burnbasket commented 2 years ago

In case this helps (the kernel is very old):

trlte:/ $ uname -vrm                                                                                                          
3.10.108-g747bc0e3 #1 SMP PREEMPT Tue Jul 27 03:55:10 PDT 2021 armv7l
Grimler91 commented 2 years ago

@burnbasket you mentioned that issue has happened for a couple of months, did it use to work before that? Could it have started with a ROM/kernel update (your kernel was built in July 2021), or do you think it started with some update to apt?

Can you also check if you have any .FAILED files, and see if it looks like a correct clearsigned file? find $PREFIX -name "*.FAILED", and if found gpg --verify /path/to/something.FAILED

burnbasket commented 2 years ago

IIRC termux did work on LineageOS 17 with these devices. I'm uncertain precisely where in the upgrade path it stopped working. I usually just installed termux and gave it the most cursory of checks. I only realized something went wrong when I actually needed the terminal and couldn't install anything from the repos.

I'm pretty sure termux apt never worked on a LOS 18+ release on these devices. EDIT: apt update never worked. apt purge game-repo DID work.

I will check if I can find renamed (*.FAILED) files.

burnbasket commented 2 years ago

I did find several FAILED files.

trlte:/ # find / -name "*.FAILED" 2>/dev/null                                                                             
/data_mirror/data_ce/null/0/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED
/data/data/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED
/data/user/0/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED
/dev/AdRkan/.magisk/mirror/data/data/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED

Let me quickly pull them and see it they verify.

burnbasket commented 2 years ago

They all verify on my workstation. Can't verify on the devices, because there's no gpg. Here is one sample:

username@machinename(20:53:25):~$ gpg --verify packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED gpg: Signature made Thu 30 Dec 2021 11:29:32 CET
gpg:                using RSA key CC72CF8BA7DBFA0182877D045A897D96E57CF20C
gpg: Good signature from "Termux Releases (Termux automatic builds) <contact@termux.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: CC72 CF8B A7DB FA01 8287  7D04 5A89 7D96 E57C F20C
Grimler91 commented 2 years ago

So looks like it has been downloaded without issues, but apt failed to verify it. From the source, it seems to be StartsWithGPGClearTextSignature or SplitClearSignedFile/readFrom that fails, and it that function issue seem to be with the getline call, since you have getline (22: Invalid argument) in your first log. getline comes from your system's libc so if it is broken there is nothing we can do from termux's side of things.

Could you run strace -o apt.log apt update and post the log somewhere?

burnbasket commented 2 years ago

Could you run strace -o apt.log apt update and post the log somewhere?

I would but can't, no strace in raw install.

Just for laughs I tried the "trusted" option in sources.list (should have done this before, sorry):

trlte:/ # cat /data/data/com.termux/files/usr/etc/apt/sources.list                                                            
# The main termux repository:
deb [trusted=yes] https://packages.termux.org/apt/termux-main stable main

Now I get a different error on apt update >au.txt 2>&1:

trlte:/ # cat /data/data/com.termux/files/home/au.txt                                                                         

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 https://packages.termux.org/apt/termux-main stable InRelease [14.0 kB]
Ign:1 https://packages.termux.org/apt/termux-main stable InRelease
Get:2 https://packages.termux.org/apt/termux-main stable Release [13.1 kB]
Get:3 https://packages.termux.org/apt/termux-main stable Release.gpg [833 B]
Err:3 https://packages.termux.org/apt/termux-main stable Release.gpg
  Signed file isn't valid, got 'NODATA' (does the network require authentication?)
Reading package lists...
E: Could not read from /data/data/com.termux/files/usr/var/lib/apt/lists/partial/packages.termux.org_apt_termux-main_dists_stable_InRelease - getline (22: Invalid argument)
E: GPG error: https://packages.termux.org/apt/termux-main stable Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)

This does speak to your getline hypothesis, like it cuts off the file somewhere. Got nothing looking for control characters, however, so the file itself doesn't seem to be the problem:

username@machinename(01:17:43):~$ cat packages.termux.org_apt_termux-main_dists_stable_InRelease.FAILED | perl -ne 'print if /[\0\cA\cB\cC\cD\cE\cF\cG\cH\cI\cK\cL\cM\cN\cO\cP\cR\cS\cT\cU\cV\cW\cX\cY\cZ\x{2068}\x{202B}]\x{202E}/;'|wc -l
0

\cJ is \n and thus legit, obviously.

I did this test only to see if the file contained control characters that proper versions of getline might have treated differently, right to left bug springs to mind.

Grimler91 commented 2 years ago

@burnbasket you can install strace with something like:

for pkg in s/strace/strace_5.14_arm.deb z/zstd/zstd_1.5.1_arm.deb libb/libblocksruntime/libblocksruntime_1%3A5.5-1_arm.deb libd/libdw/libdw_0.185-1_arm.deb libe/libelf/libelf_0.185-1_arm.deb; do 
    curl -LO https://packages.termux.org/apt/termux-main/pool/main/$pkg
done
apt install ./*.deb

Might be more dependencies missing in that list

burnbasket commented 2 years ago

Will do with http. With https, strangely, this error occurred on execution in adb shell, working directory trlte:/ # cd /data/data/com.termux/files/home/:

curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

This didn't happen in the curl downloads from termux itself.

Realtimeclock is way off:

trlte:/data/data/com.termux/files/home # hwclock
Fri Jan  9 04:10:13 1970  0.000000 seconds

Setting RTC (on root adb) fails:

trlte:/data/data/com.termux/files/home # hwclock --systohc
hwclock: ioctl 4024700a: Invalid argument
1|trlte:/data/data/com.termux/files/home # hwclock --help
usage: hwclock [-rswtluf]

Get/set the hardware clock.

-f FILE Use specified device file instead of /dev/rtc (--rtc)
-l      Hardware clock uses localtime (--localtime)
-r      Show hardware clock time (--show)
-s      Set system time from hardware clock (--hctosys)
-t      Set the system time based on the current timezone (--systz)
-u      Hardware clock uses UTC (--utc)
-w      Set hardware clock from system time (--systohc)
1|trlte:/data/data/com.termux/files/home # hwclock -w                                                                         
hwclock: ioctl 4024700a: Invalid argument

System clock is good:

1|trlte:/data/data/com.termux/files/home # date
Sat Jan  1 02:57:38 CET 2022

Will get back after strace install.

burnbasket commented 2 years ago

Strace output is here: https://drive.google.com/file/d/1CuBKPC9oCx62vMwqLA-xZeG64YqFjzOA/view

burnbasket commented 2 years ago

No joy setting RTC with explicit device number:

trlte:/data/data/com.termux/files/home # hwclock -w -f /dev/rtc0                                                              
hwclock: ioctl 4024700a: Invalid argument
1|trlte:/data/data/com.termux/files/home # ls /dev/rtc*
/dev/rtc0

UPDATE: Setting hwclock also fails in system terminal and TWRP 3.4.0 terminal. I guess I'm lucky anything works on this apparently fifty years old device at all ;-).

unman commented 2 years ago

Interestingly, I tried termx on an alcatel with stock Android, and the Grimler.se repo gave me the "NOSPLIT" response. I changed repo - no error. I'll confirm this when I can and provide a little more detail.

Grimler91 commented 2 years ago

@burnbasket time and date needs to be set though android's settings, modifying the rtc is not possible on most devices (android instead just keeps an offset file stating how far ahead real time is of the hardware clock)

burnbasket commented 2 years ago

@Grimler91 Thanks for the info, I was unaware setting rtc isn't a common thing to do on android. The system clock is ok, however, it's ntp synchronized.

I wrote the post because I was surprised the native curl command (on adb shell) returned a certificate validation error for https://packages.termux.org when the termux curl command did not.

Some posts mentioned connection errors as a possible cause for the apt update fails. The native curl was the only thing I've seen returning some kind of connection error on this device. The "certificate expired" error made me think of some kind of problem with the clock. As the system clock is correct, I mistakenly assumed hwclock must be at fault.

stale[bot] commented 2 years ago

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

louisdoe commented 2 years ago

Did you find a solution ? I have exactly the same issue, also with a Samsung N910F

ursi commented 2 years ago

Having the same issue with the f-droid install on my Onyx Boox Max Lumi 2. However, the apk from github does not have this error. But unfortunately it's completely incompatible with the styles package from f-droid - I can't even have them both installed.

ursi commented 2 years ago

huh, I reinstalled the apk version, noticed the url it was getting packages from was different, then reinstalled the f-droid version so I could try changing the url, and the f-droid version just happened to work.

alexyigidey8 commented 2 years ago

replace /etc/source.list with thise one

The main termux repository:

deb https://mirrors.tuna.tsinghua.edu.cn/osdn/storage/g/t/te/termux-old/termux-packages stable main

deb https://mirrors.bfsu.edu.cn/osdn/storage/g/t/te/termux-old/termux-packages stable main

deb https://mirror.iscas.ac.cn/osdn/storage/g/t/te/termux-old/termux-packages stable main

deb https://mirror.nju.edu.cn/osdn/storage/g/t/te/termux-old/termux-packages stable main

burnbasket commented 2 years ago

Thanks for the info. Having almost given up, still lurking.

agnostic-apollo commented 2 years ago

Post output of /system/bin/ls -lhRZ $PREFIX/var/lib/apt/lists and /system/bin/ls -lhdZ $PREFIX/var/lib/apt/lists

Also run rm -rf $PREFIX/var/lib/apt/lists and then check if everything is deleted, then run apt update.

If it still fails, then post output of apt -o Debug::Acquire::http=true -o Debug::Acquire::https=true -o Debug::Acquire::gpgv=true -o Debug::Hashes=true -o Debug::pkgAcquire=true -o Debug::pkgAcquire::Auth=true -o Debug::pkgAcquire::Worker=true update &> /sdcard/apt.log

https://manpages.debian.org/stretch/apt/apt.conf.5.en.html#DEBUG_OPTIONS

Also are you doing this on a clean install or after restoring some backup, etc? You may want to try latest version 0.118.0 from F-Droid/Github.

Realtimeclock is way off:

hwclock requires root access since /dev/rtc* wouldn't be accessible by the app user, so apt wouldn't be using it anyways. And its off by many years on both my devices as well, so that shouldn't be an issue.

And considering that such an old device/kernel is running android 11, its highly to be a device specific bug due to some incompatibility.

0x004a commented 2 years ago

Had similar issue, and fixed by "termux-change-repo" and selecting Cloudflare version.

*On Lineage 19.1 (Android 12)

spognaguloid commented 2 years ago

Not sure whether the following is of any help , but I thought I'd post just in case! I also have a note 4 (SM-N910F), on which I installed LOS 17.1 (trlte) and termux - and termux worked until I installed an update to 17.1. So I reverted to the previous version and the love for termux returned! Stupidly, I decided to upgrade to 18.1 and, guess what, termux does not work and I'm sad about that! Both times the issue was the one discussed in this thread. It looks as though I may have to revert to 17.1 if I want termux on the phone..... just need to find the version that worked!!!

HectorVda commented 2 years ago

I had the same issue, can confirm that downgrading to 117 fix the problem on a Samsung Tab A8 with Android 11!

kyze8439690 commented 2 years ago

Switch to github release build does fix this issue

https://github.com/termux/termux-app/releases/tag/v0.118.0