Hi Varvara!
I've added a comment a bit ago that "
The automating scripts are not tested since 2018 - please adjust them to current versions and your needs." I no longer have access to the machine which I used to test these and even a few years ago there were some problems with new OS, I think.
What I would recommend is to create a virtual machine manually, while you can generally follow the scripts to see what has to be installed inside of it and how interaction with the outside world may be managed. Alternatively, if you can dedicate a whole machine to SageMathCell, you can skip this step completely.
In any case I would strive to use Ubuntu 22.04 as it is used on public servers and so there should be no surprises with package names and versions.
Best,
Andrey