Hard to understand how and when to use apt-get / wget to install packages

I want to start using MQTT, but cannot seem to connect to our own server…

To test it out, I thought I would try to connect to a third-party MQTT broker like HiveMQ, which seemed to have a simple enough setup and some API examples. But I’m getting stumped. Not quite sure how I would install something like hivemq/mqtt-cli

as in the following tutorial:
MQTT CLI: Smart, Compact, Open Source (hivemq.com)

I followed the section abotu installing on Debian

$ wget 
https://github.com/hivemq/mqtt-cli/releases/download/v1.0.0/mqtt-cli_1.0.0_all.deb
$ sudo apt install ./mqtt-cli_1.0.0_all.deb

but the second line gives me
sudo: apt: command not found

I remember using apt to install other packages to my container, so thought I would try to do this from within my Docker container.
When I try to put it directly in my container like this:

$ docker ps
$ docker exec -it [container ID] bash
#  wget https://github.com/hivemq/mqtt-cli/releases/download/v1.0.0/mqtt-cli_1.0.0_all.deb
bash: wget: command not found
# sudo apt install ./mqtt-cli_1.0.0_all.deb
[sudo] password for torizon:
Sorry, try again.

So I seem to not have the password for the container… I tried torizon, root, “nothing” and the password that I have set when first logging in to the target.

Should I perhaps be putting these packages into the extrapackages in VSCODE torizon extenstion field?

Leigh

Greetings @leighjboyd,

So I seem to not have the password for the container… I tried torizon, root, “nothing” and the password that I have set when first logging in to the target.

Be the root user inside the container and execute without sudo.

Should I perhaps be putting these packages into the extrapackages in VSCODE torizon extenstion field?

The extrapackages field is only for installing packages that are available on the Debian feed. This package is not available on the Debian feed. Looking at the options here: C/C++ Development and Debugging on TorizonCore Using Visual Studio Code | Toradex Developer Center

You probably want the preinstallcommands or buildcommands field. There you can specify the commands you want run in the container via the Dockerfile.

Best Regards,
Jeremias