Install cuda 10.0 without internet or gui on ubuntu 1804 recovery prompt

I have a machine with a newly created ubuntu 1804 instance and it is incapable of loggin on due to missing graphics driver. I want to install CUDA 10.0 at the same time (I need CUDA too) and I figured I would use its driver. My issue is that the machine I want to install to does not have internet access. I was wondering what the process would be to install CUDA and its graphics driver from a local deb file that was transfered over via thumb drive. How do I download the correct CUDA version from another machine that contains the full multiple gigabyte installation file? I cannot run sudo apt update so I am hoping somebody can explain to me how to get around the no internet issue.

Thanks

It might be easier to use a runfile installer. That should be easy enough to put on a thumbdrive. It does not require internet access.

So I should install the driver, cuda, and examples through runfile?

Edit:

I tried the installation and it is erroring out saying I don’t have build-essential (actually, “gcc”, but you get the point) installed. Is there a non-internet way to install that? I am finding the internet issue is the root cause of all of my problems. I also tried booting regularly, but then pressing Ctrl+Alt+F3 but that doesn’t seem to do anything either.

What should I do?

It’s possible to install gcc if you start with the right linux install. Most linux distros give you an oppty to install extra packages directly from the source install disk.

So, for example, with fedora you could install the “development workstation” group, and you will get g++ tools installed. You may also need to select kernel development packages.

I can’t give you an exact recipe for Ubuntu 18.04, but I’m pretty sure its possible. Anyway that is a linux question, not a CUDA question.