Ngrok is not reflected in app qube

I switched my app qube template to a clone of the template it was previously using and shut down the app qube.

In the newly cloned template (let’s call it app-qube-template-clone), I installed Ngrok following the instructions here

When I started the app qube (after shutting down the app-qube-template-clone so that the changes would reflect) and tried to run the ngrok command, I got the following message:

$ ngrok
bash: ngrok: command not found

Here’s the troubleshooting I was able to do that suggests that the ngrok command was installed:

$ sudo apt install ngrok
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ngrok is already the newest version (3.23.2).
$ sudo apt list --installed | grep ngrok

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

ngrok/buster,now 3.23.2 amd64 [installed]
$ dpkg -l ngrok
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  ngrok          3.23.2       amd64        ngrok secure tunnel agent

Is there a way to solve the command not showing in the qube?

1 Like

I took a quick look, and it seems that the ngrok binary is being installed in the /usr/local/bin directory, which is part of the template’s private volume. This means that it won’t be available in any other qubes based on that template.

One solution is to create a post-action with apt to automatically move ngrok to the correct directory.

In the template:

echo "DPkg::Post-Invoke { \"mv /usr/local/bin/ngrok /usr/bin/ngrok || true\" };" | sudo tee -a /etc/apt/apt.conf.d/99_ngrok

Then reinstall to trigger the command:

sudo apt reinstall ngrok
3 Likes

In addition, Debian 10 ‘Buster’ is EOL, so I highly recommend upgrading your template.

1 Like

Yes. But I don’t have anything in the template settings for which template it is based on.
Would running apt dist-upgrade suffice here?

1 Like

You can check by running the command cat /etc/debian_version.
If the output is 12.11, then you have the latest version.
I guess you are already using Debian 12; the ngrok repository just still uses the codename buster, as seen in the documentation.

echo "deb https://ngrok-agent.s3.amazonaws.com buster main"
2 Likes

Okay, then those instructions can be slightly updated:

echo "deb https://ngrok-agent.s3.amazonaws.com bullseye main"

Bookworm is not listed in the XML file.