Script to facilitate installation of cuda 12.4 on Ubuntu

I want to offer an R package based on Cuda. To make it work, you need to install cuda beforehand, but I’m a bit afraid that users will be put off by the complexity of the installation.

So I’m thinking of offering a script:

Here’s what I’ve done:

Does this look right to you?

The aim is for the script to work on Ubuntu 20.04 or higher and not to break the system.

Thanks a lot!