0

I'm interested to configure the Termux repositories on a Debian system. However I got stuck on some point. Any help would be appreciated.

Premise

My scenario is as follows. I have an Android device running the Debian-alike Linux environment emulator Termux employing the package manager APT. Out of security reasons the device is airgapped, so packages can not be retrieved from Termux' remote repositories but have to be installed locally.

To bring the necessary .deb files onto this device I therefore have to use an intermediate machine with online access to Termux' repositories. The packages needed would be downloaded there, but not installed, and than transferred to the target device.

Obviously, the simple solution would be to use another Android device. However, for now I am bound to a PC running the minimalistic Debian-derivate AntiX 22 (matching Debian 11) in the core flavor.

Note, that Termux is not FHS compliant and therefore the usual Debian or Ubuntu repositories cannot be used.

Aim

To configure the Termux repository resp. one of its mirrors on a machine running Debian or a Debian-derivate, esp. AntiX.

Steps

I aimed at Grimler's mirror as it was recommended in various situations. Any other server would be fine, too.

According to the Debian documentation's Instructions to connect to a third-party repository, Ubuntu's documentation article on Third party repository usage and various other sources, inter alia this Stackoverflow post one has basically 4 steps to go:

  1. Fetch the GPG key for the Termux repository
  2. List the repo in an APT source file
  3. Run apt update to integrate the repo
  4. Configure the repo's pinning

Note: apt-key is deprecated, however I tried also that. If one can show me the way employing apt-key, I won't mind, but that can only be an interim solution.

Problem

No matter what I try, I get stuck on step 3, when apt tells me:

Err https://grimler.se/termux-main stable InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A897D96E57CF20C 

Approaches

I combined variations for steps 1-3.

Tinkering on the GPG file

I tried the termux-keyring package first. As mentioned one can't install it directly to a Debian system, so I took it apart, and placed all files manually into the right places. The public GPG files into /usr/share/termux-keyring/, resp. in another try in the already existing /usr/share/keyrings/. I also accordingly placed the symlinks -- in another try the files themselves -- into /etc/apt/trusted.gpg.d/ pointing to these GPG files.

As it is actually not recommended to put something into /etc/apt/trusted.gpg.d/ I than removed the symlinks resp. the GPG files from there. Only /usr/share/keyrings/ has been used further.

Getting paranoia that I'm using the wrong key files I also tried to use the public keys from Grimler's homepage and Repository but without change. Dearmoring and armoring also yields nothing.

The list file

My /etc/apt/sources.list.d/grimler.list just contains the line

deb [signed-by=/usr/share/keyrings/grimler.gpg] https://grimler.se/termux-main stable main 

Leaving out the signed-by doesn't change anything, which I actually consider to be strange. Changing https to http makes no difference, too.

Finding the unfound public key

To solve the error message

Err https://grimler.se/termux-main stable InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A897D96E57CF20C 

I naturally tried to solve the problem with

$ gpg --no-default-keyring --keyring grimler.gpg --keyserver keyserver.ubuntu.com --recv-keys 5A897D96E57CF20C 

and

$ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5A897D96E57CF20C 

and similar. Alas, though the key has been imported, the error message remained.

Summary

So, how do I configure a Termux repository in Debian? Esp.

  • Which keys do I have to use from where, and where to put them? Do they have to be modified in some way?
  • Is something missing in the source file?
  • How to feed APT the public key 5A897D96E57CF20C?

Thanks in advance for your time and any helpful advice. Feel free to ask or comment, if need be I'll add further information.

4
  • Fingerprint of grimler.gpg is B0076E490B71616B which is different from the 5A897D96E57CF20C. The correct key seems to be keyserver.ubuntu.com/pks/…. Commented Nov 5, 2023 at 2:56
  • Alas, using this key, whether armored or dearmored, also results in the same above mentioned error -- The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A897D96E57CF20C. Commented Nov 7, 2023 at 9:55
  • that's weird. i did added deb [signed-by=/tmp/lookup.asc] https://grimler.se/termux-main stable main, where lookup.asc key with fingerprint 5A897D96E57CF20C and it works. Commented Nov 7, 2023 at 10:05
  • Thx, that was indeed helpful. It turns out that the file extension .asc was expected. The error now disappeared, however I get a new one: Unknown error executing apt-key. Very informative message. Commented Nov 7, 2023 at 15:42

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.