2024-09-06 6:04 AM - last edited on 2024-09-06 7:14 AM by mƎALLEm
Hello
I am new to this forum, so if I am at the wrong place, let me know.
How can this software: https://www.st.com/en/development-tools/stm32cubeclt.html be installed from a script? Namely into docker container?
I get the following error:
``` DISPLAY not set. Cannot display license. Aborting. ```
Thanks in advance.
Solved! Go to Solution.
2024-09-09 4:32 AM
Try setting this env:
LICENSE_ALREADY_ACCEPTED=1
It works for STM32CubeIDE.
2024-09-07 2:58 PM
What if you just install cubeclt on a normal linux machine with a display (yes, manually), then copy the stuff into container, post the result to your container server and be done with it?
2024-09-08 11:52 PM
Thanks for the suggestion. I will consider this.
I was wondering, though, if there is no way to do it automatically, as I would like to build the container automatically from a script as well. Is this really an edge-use-case? I would have thought, that the installer would provide a way to accept the license agreement from a script? I tried `echo y | install_script` and the like. It does not work.
If there is no way, where to post the feature request?
Thanks.
2024-09-09 3:23 AM
@mƎALLEm could you look at this request? Is there a "legal" way to bypass the license annoyance for headless installation?
2024-09-09 3:50 AM
Hello @cla
First let me thank you for posting.
In fact, during the installation it's required that the license agreement is done manually by the user.
I will raise your request internally and give you updates as soon as I get them.
KR,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-09-09 4:32 AM
Try setting this env:
LICENSE_ALREADY_ACCEPTED=1
It works for STM32CubeIDE.
2024-09-10 6:11 AM
Final command:
```
unzip ./en.st-stm32cubeclt_1.16.0_xxxxx.sh.zip && \
chmod +x ./st-stm32cubeclt_1.16.0_xxxxx.sh && \
echo | sudo LICENSE_ALREADY_ACCEPTED=1 ./st-stm32cubeclt_1.16.0_xxxxx.sh
```
`echo` sends newline to accept default install directory (there might be a better approach, but this worked).
2024-12-18 1:31 PM
That's a good solution as well. Honestly, it's probably the cleaner solution.
I ended up just using an expect script to install on a devcontainer. Ensure you install procps-ng and expect before you run it if you do it this way. Then just remove the packages after it's installed. Here's the expect script.
#!/usr/bin/expect
# Path to your shell script
set script "/tmp/st-stm32cubeclt_1.17.0_23554_20241124_1810_amd64.sh"
# Start the script
spawn $script --nox11
# Automatically handle the --More-- paging prompt
expect {
-re "--More--" {
send "q"
exp_continue
}
-re {\[[NY]/[yn]\]}
{
send "y\n"
exp_continue
}
-re {STM32CubeCLT install dir\?}
{
send "/opt/st/stm32cubeclt_1.17.0\n"
exp_continue
}
}
# Wait for the script to finish
expect eof
2025-03-21 3:51 AM
This solution is ok for 1.16.0 but it doesn't work for 1.18.0... I don't know why though. :(
2025-03-23 1:14 PM
Why not to use a custom container image with certain CubeIDE version already installed and tweaked up as needed? Anyway you have to keep the copy of CubeIDE installer in your private storage because downloading it from ST requires login.